Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

enable option window in user chat #151

Open
ssubham opened this issue Apr 9, 2020 · 5 comments
Open

enable option window in user chat #151

ssubham opened this issue Apr 9, 2020 · 5 comments
Labels

Comments

@ssubham
Copy link

ssubham commented Apr 9, 2020

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
Copy link
Owner

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
Copy link
Author

ssubham commented Apr 16, 2020

point1
Want this option to enable.

@ssubham
Copy link
Author

ssubham commented Apr 16, 2020

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
Copy link

@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

@Vegeta0807
Copy link

@buymybm100 You saved me. Thanks mate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants