[smuxi: 1/2] Engine-XMPP: also send presence updates to MUCs, see XEP-0045 (closes: #1005)
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi: 1/2] Engine-XMPP: also send presence updates to MUCs, see XEP-0045 (closes: #1005)
- Date: Tue, 23 Dec 2014 17:09:47 +0000 (UTC)
commit a465611e751b68420a99b0d7bf013e3631779f3e
Author: Mirco Bauer <meebey meebey net>
Date: Tue Dec 23 18:05:18 2014 +0100
Engine-XMPP: also send presence updates to MUCs, see XEP-0045 (closes: #1005)
.../Protocols/Xmpp/XmppProtocolManager.cs | 25 ++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
b/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
index cb95053..47c51aa 100644
--- a/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
+++ b/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
@@ -635,6 +635,31 @@ namespace Smuxi.Engine
}
JabberClient.SendMyPresence();
+
+ // send presence update to all MUCs, see XEP-0045:
+ // http://xmpp.org/extensions/xep-0045.html#changepres
+ foreach (var chat in Chats) {
+ if (!(chat is XmppGroupChatModel)) {
+ continue;
+ }
+ var muc = (XmppGroupChatModel) chat;
+
+ var to = new Jid(muc.ID) {
+ Resource = muc.OwnNickname
+ };
+
+ var presence = new Presence() {
+ Show = JabberClient.Show,
+ Status = JabberClient.Status,
+ From = JabberClient.MyJID,
+ To = to
+ };
+
+ if (JabberClient.EnableCapabilities) {
+ presence.AddChild(JabberClient.Capabilities);
+ }
+ JabberClient.Send(presence);
+ }
}
[MethodImpl(MethodImplOptions.Synchronized)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]