ng-chat icon indicating copy to clipboard operation
ng-chat copied to clipboard

enable option window in user chat

Open ssubham opened this issue 4 years ago • 5 comments

Hi I want to use group option. but not able to use it. tried from reference/sample. but, not got success.

Also, want to use custom theme. Let me know how can i do this....

ssubham avatar Apr 09 '20 11:04 ssubham

Hi @ssubham ,

For a group adapter example, you can check it out over here: https://github.com/rpaschoal/ng-chat-netcoreapp/blob/master/NgChatClient/ClientApp/src/app/signalr-group-adapter.ts

The above is the source code used by the demo.

For a custom theme, you will need to pass a valid asset URL to customTheme as described on the docs, and your CSS should start with a custom-theme selector. You can customize the same items as seen on these 2 pre-built themes:

https://github.com/rpaschoal/ng-chat/blob/master/src/ng-chat/assets/themes/ng-chat.theme.default.scss

https://github.com/rpaschoal/ng-chat/blob/master/src/ng-chat/assets/themes/ng-chat.theme.dark.scss

rpaschoal avatar Apr 16 '20 00:04 rpaschoal

point1 Want this option to enable.

ssubham avatar Apr 16 '20 02:04 ssubham

Have found one issue. When, i send a message to an user first time. the chat window got open on recipient but, the message does not shown there.

point2

ssubham avatar Apr 16 '20 02:04 ssubham

@ssubham, to enable Groups , you need these steps:

  1. implement the IChatGroupAdapter interface in your adapter (eg. SocketIOAdapter.ts)

  2. specify the [groupAdapter] attribute in

The examples are clear on the above points, the missing link is on the server side. Chat Participants must have a 'participantType' = ChatParticipantType.User

  1. If you are running the ng-chat-nodejs example, go into server.js and

    socket.on('join', function(username) { // Same contract as ng-chat.User usersCollection.push({ participant: { id: socket.id, // Assigning the socket ID as the user ID in this example displayName: username, status: 0, // ng-chat UserStatus.Online, avatar: null, participantType: 0 //ChatParticipantType.User } }); .....

Hope this helps, Beemer

buymybm100 avatar Nov 13 '20 08:11 buymybm100

@buymybm100 You saved me. Thanks mate.

Vegeta0807 avatar Feb 06 '23 08:02 Vegeta0807