Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
skhanna #1
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Subject: Receive Message handler for group chat and normal chat
Hi Alex,

I am using group chat and one-one chat (normal). For group chat I register

  1. _xmppClient.XmppClient.MessageFilter.Add(jid, new BareJidComparer(), MessageCallback);

for receive normal message I have register

  1. _xmppClient.XmppClient.OnMessage += XmppClient_OnMessage;

When I send message to room that time I am getting message on MessageCallback. But when I send message to user that time I am not getting message on XmppClient_OnMessage handler.

Thanks
Sanjeev
This post was edited on 2016-08-03, 20:00 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is correct behaviour, only groupchat messages are sent back to you from the XMPP server, but not 1:1 chat messages.
Avatar
skhanna #3
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Thanks. How to receive both type of messages?

Sanjeev
Avatar
skhanna #4
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
I don't want to add message filter for specific user. I want to receive messages from all openfire users.
Avatar
Alex #5
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
When you send a 1:1 chat message you don't receive it yourself, only the recipient receives it in the OnMessage handler.
As I said before, in MUC this is different and you receive also outgoing messages in the OnMessage handler.

This is how the protocols are designed.
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: