Beispiel #1
0
        private void GotBookmarks(object sender, IQ iq, object state)
        {
            if ((iq == null) || (iq.Type != IQType.result))
            {
                return;
            }

            Private priv = iq.Query as Private;

            if (priv == null)
            {
                return;
            }

            Bookmarks bm = priv.GetChildElement <Bookmarks>();

            if (bm == null)
            {
                return;
            }

            foreach (BookmarkConference conf in bm.GetConferences())
            {
                if (conf.JID == null)
                {
                    continue;
                }

                m_conferences[conf.JID] = conf;
                if (OnConferenceAdd != null)
                {
                    OnConferenceAdd(this, conf);
                }
                if (conf.AutoJoin && (m_confManager != null))
                {
                    JID  rJID        = conf.JID;
                    JID  roomAndNick = new JID(rJID.User, rJID.Server, conf.Nick);
                    Room r           = m_confManager.GetRoom(roomAndNick);
                    r.Join(conf.Password);
                }
            }
        }