Example #1
0
        private void C_NewBookmarksResultMessage(XMPPClient client, NewBookmarksResultMessageEventArgs args)
        {
            foreach (ConferenceItem c in args.BOOKMARKS_MESSAGE.STORAGE.CONFERENCES)
            {
                bool   newMUC = false;
                string to     = client.getXMPPAccount().getIdAndDomain();
                string from   = c.jid;
                string id     = ChatTable.generateId(from, to);

                // Create / update chat:
                ChatTable chat = ChatDBManager.INSTANCE.getChat(id);
                if (chat == null)
                {
                    chat = new ChatTable()
                    {
                        id            = id,
                        chatJabberId  = from,
                        userAccountId = to,
                        ask           = null,
                        lastActive    = DateTime.Now,
                        muted         = false,
                        status        = null,
                        subscription  = null
                    };
                    newMUC = true;
                }
                chat.chatType = ChatType.MUC;
                chat.inRoster = true;
                chat.presence = Presence.Unavailable;

                ChatDBManager.INSTANCE.setChat(chat, false, true);

                // Create / update MUC info:
                MUCChatInfoTable info = MUCDBManager.INSTANCE.getMUCInfo(chat.id);
                if (info == null)
                {
                    info = new MUCChatInfoTable
                    {
                        chatId  = chat.id,
                        subject = null
                    };
                    newMUC = true;
                }

                info.autoEnterRoom = c.autoJoin;
                info.name          = c.name;
                info.nickname      = c.nick;
                info.password      = c.password;

                MUCDBManager.INSTANCE.setMUCChatInfo(info, false, true);


                // Enter MUC manually if the MUC is new for this client:
                if (newMUC && info.autoEnterRoom && !Settings.getSettingBoolean(SettingsConsts.DISABLE_AUTO_JOIN_MUC))
                {
                    Task.Run(() => MUCHandler.INSTANCE.enterMUCAsync(client, chat, info));
                }
            }
        }
Example #2
0
 private void Connection_NewBookmarksResultMessage(XmppConnection sender, NewBookmarksResultMessageEventArgs args)
 {
     NewBookmarksResultMessage?.Invoke(this, args);
 }
Example #3
0
 private void Connection_NewBookmarksResultMessage(XMPPConnection2 connection, NewBookmarksResultMessageEventArgs args)
 {
     NewBookmarksResultMessage?.Invoke(this, args);
 }