Smuxi.Engine.XmppProtocolManager.SendPrivateMessage C# (CSharp) Method

SendPrivateMessage() private method

private SendPrivateMessage ( Smuxi.Engine.XmppPersonModel person, Jid jid, string text ) : void
person Smuxi.Engine.XmppPersonModel
jid Jid
text string
return void
        void SendPrivateMessage(XmppPersonModel person, Jid jid, string text)
        {
            if (jid == null) {
                jid = person.Jid;
            }
            if ((jid.Server == "gmail.com") ||
                (jid.Server == "googlemail.com")) {
                // don't send to all high prio resources or to specific resources
                // because gtalk clones any message to all resources anyway
                _SendPrivateMessage(person, jid.Bare, text);
            } else if (!String.IsNullOrEmpty(jid.Resource)) {
                _SendPrivateMessage(person, jid, text);
            } else {
                var resources = person.GetResourcesWithHighestPriority();
                if (resources.Count == 0) {
                    // no connected resource, send to bare jid
                    _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);
                    }
                }
            }
        }

Same methods

XmppProtocolManager::SendPrivateMessage ( Smuxi.Engine.XmppPersonModel person, string text ) : void