Beispiel #1
0
        public void BareJidEqualsTest()
        {
            var a = new Jid("[email protected]/Res1");
            var b = new Jid("[email protected]/Res2");

            a.Equals(b, new BareJidComparer()).ShouldBe(true);
        }
Beispiel #2
0
        public void FullJidEqualsTest()
        {
            var a = new Jid("[email protected]/Res1");
            var b = new Jid("[email protected]/Res2");
            var c = new Jid("[email protected]/Res2");
            var d = new Jid("[email protected]/Res2");

            a.Equals(b, new FullJidComparer()).ShouldBe(false);
            b.Equals(c, new FullJidComparer()).ShouldBe(true);
            //c.Equals(d, new FullJidComparer()).ShouldBe(true);
        }
Beispiel #3
0
 string getNameByJID(Jid jid)
 {
     foreach (RosterItem item in friendList)
     {
         if (jid.Equals(item.Jid))
         {
             return(item.Name);
         }
     }
     return("неизвестный");
 }
Beispiel #4
0
        private void SendStreamHostsResult(object sender, IQ iq, object data)
        {
            //  <iq xmlns="jabber:client" type="result" to="[email protected]/Psi" id="aab6a">
            //      <query xmlns="http://jabber.org/protocol/bytestreams">
            //          <streamhost-used jid="[email protected]/Psi" />
            //      </query>
            //  </iq>
            if (iq.Type == IqType.result)
            {
                ByteStream bs = iq.Query as ByteStream;
                if (bs != null)
                {
                    Jid sh = bs.StreamHostUsed.Jid;
                    if (sh != null & sh.Equals(m_XmppCon.MyJID, new agsXMPP.Collections.FullJidComparer()))
                    {
                        // direct connection
                        SendFile(null);
                    }
                    //if (sh != null & sh.Equals(new Jid(PROXY), new agsXMPP.Collections.FullJidComparer()))
                    if (sh != null)
                    {
                        m_Sid                           = iq.Query.Attributes["sid"].ToString();
                        _p2pSocks5Socket                = new JEP65Socket();
                        _p2pSocks5Socket.Address        = PROXY;
                        _p2pSocks5Socket.Port           = 7777;
                        _p2pSocks5Socket.Target         = m_To;
                        _p2pSocks5Socket.Initiator      = m_XmppCon.MyJID;
                        _p2pSocks5Socket.SID            = m_Sid;
                        _p2pSocks5Socket.ConnectTimeout = 5000;
                        _p2pSocks5Socket.SyncConnect();

                        if (_p2pSocks5Socket.Connected)
                        {
                            ActivateBytestream(new Jid("proxy." + PROXY));
                        }
                        //_proxySocks5Socket = new JEP65Socket();
                        //_proxySocks5Socket.Address = PROXY;
                        //_proxySocks5Socket.Port = 7777;
                        //_proxySocks5Socket.Target = m_To;
                        //_proxySocks5Socket.Initiator = m_XmppCon.MyJID;
                        //_proxySocks5Socket.SID = m_Sid;
                        //_proxySocks5Socket.ConnectTimeout = 5000;
                        //_proxySocks5Socket.SyncConnect();

                        //if (_proxySocks5Socket.Connected)
                        //    ActivateBytestream(new Jid(PROXY));
                    }
                }
            }
        }
 internal MucRoomMember FindByRealJid(Jid jid)
 {
     return(Find((x) => jid.Equals(x.RealJid)));
 }
 public static bool Equals( Jid jid, Jid jid2 )
 {
     return jid.Equals( jid2 ) ;
 }
Beispiel #7
0
        public override bool Equals(object obj)
        {
            var u = obj as User;

            return(u != null && Jid.Equals(u.Jid));
        }
Beispiel #8
0
 public bool Equals(object other, IComparer comparer)
 {
     return(_jid.Equals(other, comparer));
 }