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

Provide SignalR example for group chat #107

Closed
rpaschoal opened this issue Mar 18, 2019 · 4 comments
Closed

Provide SignalR example for group chat #107

rpaschoal opened this issue Mar 18, 2019 · 4 comments

Comments

@rpaschoal
Copy link
Owner

I know this is not part of this issue, but please check this:
https://stackoverflow.com/questions/54894884/cant-receive-messages-from-groups-ng-chat

Originally posted by @JosePolanco18 in #105 (comment)

@rpaschoal
Copy link
Owner Author

rpaschoal commented Mar 18, 2019

Some details on the issue for future reference as first replied on StackOverflow:

ng-chat treats groups as individual participants. You will have to join your room when this event gets invoked:

groupCreated(group: Group): void {
    console.log( group);
    // Invoke your SignalR hub and send the details of the newly created group
}

ng-chat will generate unique ids every time a group is created so you can track which group is which whenever one gets created from a running ng-chat instance. How you will handle the persistence of these groups is up to your application.

You might want to push a notification to involved users from your SignalR adapter that their friends list has changed (They'll be able to see the group at this stage). You could also decide not to do so and only push a notification if the user who has created the group send an initial message (Once again, up to your application requirements and needs).

You might also want to implement IChatGroupAdapter on your adapter to make the contract more explicit.

Hope this helps!

@rpaschoal
Copy link
Owner Author

I'll soon be adding support for group chat on the SignalR adapter example found here: https://github.com/rpaschoal/ng-chat-netcoreapp

@rpaschoal
Copy link
Owner Author

rpaschoal commented Mar 25, 2019

From my StackOverflow answer:

I've just pushed some changes on the "ng-chat-netcoreapp" repository. Have a look at the changes added with this pull request and look at the simple group chat example implementation I've added there: github.com/rpaschoal/ng-chat-netcoreapp/pull/1. Please note this is a quick implementation for a group chat adapter but it should be enough to get your head around the message and participants cycle. You should elaborate more on your code base for your adapter and hub to get production grade code in shape.

While testing I think I've found a minor bug with group messages not being marked as read. I'll do some more testing and confirm it is really a bug and push a patch anytime soon for it.

@rpaschoal
Copy link
Owner Author

The bug for unread messages not being marked as read for group chats has been released with version 2.0.2.

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

No branches or pull requests

1 participant