Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
hardmanii #1
Member since Apr 2011 · 20 posts · Location: seoul
Group memberships: Members
Show profile · Link to this post
Subject: How do I implement a group chat?
Hi Alex.
 
I really thank you for the answer.
 
But, I don't know how to control the groupchat.
 
This is the coding that I added when a user is added in a chat room.
 
                this._MucManager = new MucManager(_XmppClient);
                _MucManager.EnterRoom(rn.RosterItem.Jid, rn.RosterItem.Name, true);
 
                Util.ChatForms.Add(rn.RosterItem.Jid.ToString().ToLower(), this);
                _XmppClient.MessageFilter.Add(rn.RosterItem.Jid, new BareJidComparer(), OnMessage);
 
 
I wanna ask you a question.
When a user is chatting with 3 people, should I send a message to each user who is chatting with the user?
 
sUserid = 1 people
 
Jid _GroupJid = new Jid(sUserid, domain, CNST_DEFAULT_XMPP_RESOURCE);
var msg = new Message { Type = MessageType.groupchat, To = _GroupJid, Body = msgBody };
_XmppClient.Send(msg);
 
 
 
sUserid = 2 people
 
Jid _GroupJid = new Jid(sUserid, domain, CNST_DEFAULT_XMPP_RESOURCE);
var msg = new Message { Type = MessageType.groupchat, To = _GroupJid, Body = msgBody };
_XmppClient.Send(msg);
 
 
sUserid = 3 people
 
Jid _GroupJid = new Jid(sUserid, domain, CNST_DEFAULT_XMPP_RESOURCE);
var msg = new Message { Type = MessageType.groupchat, To = _GroupJid, Body = msgBody };
_XmppClient.Send(msg);
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
when all 3 users join a chatroom then you send the message once to the room, and all 3 users will get the message in an OnMessage event (even the sender).
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS