[smuxi/stable] Engine-XMPP: fix sending messages to empty resources
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [smuxi/stable] Engine-XMPP: fix sending messages to empty resources
 
- Date: Sun, 14 Feb 2016 20:38:53 +0000 (UTC)
 
commit 973922dce26f34ff1c3eecaf8f91c447ce783cd8
Author: Mirco Bauer <meebey meebey net>
Date:   Sun Feb 14 21:36:25 2016 +0100
    Engine-XMPP: fix sending messages to empty resources
    
    XmppPersonModel.Resources may contain an empty resource, not sure what the
    purpose is but we can't send messages to user example com/ as that is not a
    valid destination.
 .../Protocols/Xmpp/XmppProtocolManager.cs          |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs 
b/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
index 8006c3c..61388f2 100644
--- a/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
+++ b/src/Engine-XMPP/Protocols/Xmpp/XmppProtocolManager.cs
@@ -1380,6 +1380,10 @@ namespace Smuxi.Engine
                     SendPrivateMessage(person, jid.Bare, text);
                 } else {
                     foreach (var res in resources) {
+                        if (String.IsNullOrEmpty(res.Name)) {
+                            // don't send messages to empty resources
+                            continue;
+                        }
                         Jid j = new Jid(jid);
                         j.Resource = res.Name;
                         SendPrivateMessage(person, j, text);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]