rpaschoal / ng-chat

💬 A simple facebook/linkedin lookalike chat module for Angular applications.
MIT License
155 stars 92 forks source link

enable option window in user chat #151

Open ssubham opened 4 years ago

ssubham commented 4 years ago

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....

rpaschoal commented 4 years ago

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

ssubham commented 4 years ago

point1 Want this option to enable.

ssubham commented 4 years ago

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

buymybm100 commented 3 years ago

@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

3) 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

Vegeta0807 commented 1 year ago

@buymybm100 You saved me. Thanks mate.