Snippets for http://fagner.co/2016/02/28/Omegle-clone-using-SignalR/
Created
February 29, 2016 02:35
-
-
Save fagnercarvalho/c8997eb4d77fe91f803c to your computer and use it in GitHub Desktop.
2016-02-28-Omegle-clone-using-SignalR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void Send(string message) | |
| { | |
| var user = this.Context.ConnectionId; | |
| var chat = GetChatByUser(user); | |
| if (chat == null) | |
| { | |
| return; | |
| } | |
| if (chat.User1 == user) | |
| { | |
| Clients.Client(chat.User2).receiveMessage(message); | |
| } | |
| else | |
| { | |
| Clients.Client(chat.User1).receiveMessage(message); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment