예제 #1
0
 //--------------------------------------------------------Events:---------------------------------------------------------------------\\
 #region --Events--
 private void accountSelection_asc_AddAccountClicked(object sender, object args)
 {
     if (setBookmarkHelper != null)
     {
         setBookmarkHelper.Dispose();
         setBookmarkHelper = null;
     }
     Hide();
 }
예제 #2
0
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--


        #endregion

        #region --Misc Methods (Private)--
        private void requestDisoInfo()
        {
            CONNECTION.account.CONNECTION_INFO.msgCarbonsState = MessageCarbonsState.DISABLED;
            if (discoMessageResponseHelper != null)
            {
                discoMessageResponseHelper.Dispose();
            }
            discoMessageResponseHelper = new MessageResponseHelper <IQMessage>(CONNECTION, onDiscoMessage, onDiscoTimeout);
            discoMessageResponseHelper.start(new DiscoRequestMessage(CONNECTION.account.getFullJid(), CONNECTION.account.user.domainPart, DiscoType.INFO));
        }
        private void showResultDisco(DiscoResponseMessage disco)
        {
            rooms.Clear();
            messageResponseHelper?.Dispose();
            messageResponseHelper = null;

            if (disco == null || disco.ITEMS == null || disco.ITEMS.Count <= 0)
            {
                // Show non found in app notification:
                noneFound_notification.Show("None found. Please retry!");
            }
            else
            {
                foreach (DiscoItem i in disco.ITEMS)
                {
                    rooms.Add(new MUCRoomTemplate()
                    {
                        client   = Client,
                        roomInfo = new MUCRoomInfo()
                        {
                            jid  = i.JID ?? "",
                            name = i.NAME ?? (i.JID ?? "")
                        }
                    });
                }
            }

            loading_grid.Visibility = Visibility.Collapsed;
            main_grid.Visibility    = Visibility.Visible;
        }
예제 #4
0
 private void reload()
 {
     reload_btn.IsEnabled = false;
     retry_btn.IsEnabled  = false;
     messageResponseHelper?.Dispose();
     messageResponseHelper = null;
     requestRoomInfo();
 }
예제 #5
0
 private void addBookmark()
 {
     hideError();
     if (CLIENT == null || !CLIENT.isConnected())
     {
         showError("Client not connected!");
     }
     else
     {
         if (messageResponseHelper != null)
         {
             messageResponseHelper.Dispose();
         }
         List <ConferenceItem> conferences = MUCDBManager.INSTANCE.getXEP0048ConferenceItemsForAccount(CLIENT.getXMPPAccount().getIdAndDomain());
         CLIENT.PUB_SUB_COMMAND_HELPER.setBookmars_xep_0048(conferences, onMessage, onTimeout);
     }
 }
        private void UpdateBookmarks(XMPPClient client)
        {
            List <ConferenceItem> conferences = MUCDBManager.INSTANCE.getXEP0048ConferenceItemsForAccount(client.getXMPPAccount().getBareJid());

            if (updateBookmarksHelper != null)
            {
                updateBookmarksHelper.Dispose();
            }
            updateBookmarksHelper = client.PUB_SUB_COMMAND_HELPER.setBookmars_xep_0048(conferences, OnUpdateBookmarksMessage, OnUpdateBookmarksTimeout);
        }
예제 #7
0
        private void showResultDisco(DiscoResponseMessage disco)
        {
            rooms.Clear();
            messageResponseHelper?.Dispose();
            messageResponseHelper = null;

            if (disco is null || disco.ITEMS is null || disco.ITEMS.Count <= 0)
            {
                // Show non found in app notification:
                noneFound_notification.Show("None found. Please retry!");
            }
        private void UpdateBookmarks(XMPPClient client)
        {
            List <ConferenceItem> conferences = MUCDBManager.INSTANCE.getXEP0048ConferenceItemsForAccount(client.getXMPPAccount().getBareJid());

            if (updateBookmarksHelper != null)
            {
                updateBookmarksHelper.Dispose();
            }
            // TODO: Register callbacks for once an error occurred and show a notification to the user
            updateBookmarksHelper = client.PUB_SUB_COMMAND_HELPER.setBookmars_xep_0048(conferences, null, null);
        }
예제 #9
0
        public void reset()
        {
            setState(OmemoHelperState.DISABLED);

            CONNECTION.ConnectionStateChanged -= CONNECTION_ConnectionStateChanged;
            CONNECTION.ConnectionStateChanged += CONNECTION_ConnectionStateChanged;

            CONNECTION.NewValidMessage -= CONNECTION_ConnectionNewValidMessage;
            CONNECTION.NewValidMessage += CONNECTION_ConnectionNewValidMessage;

            tmpDeviceId = 0;

            if (requestDeviceListHelper != null)
            {
                requestDeviceListHelper.Dispose();
                requestDeviceListHelper = null;
            }
            if (updateDeviceListHelper != null)
            {
                updateDeviceListHelper.Dispose();
                updateDeviceListHelper = null;
            }
            if (announceBundleInfoHelper != null)
            {
                announceBundleInfoHelper.Dispose();
                announceBundleInfoHelper = null;
            }
            if (requestDeviceListStatelessHelper != null)
            {
                requestDeviceListStatelessHelper.Dispose();
                requestDeviceListStatelessHelper = null;
            }
            if (resetDeviceListStatelessHelper != null)
            {
                resetDeviceListStatelessHelper.Dispose();
                resetDeviceListStatelessHelper = null;
            }

            requestDeviceListStatelessOnResult = null;
            resetDeviceListStatelessOnResult   = null;
        }
        private void UpdateBookmarks(XMPPClient client)
        {
            List <ConferenceItem> conferences;

            using (MainDbContext ctx = new MainDbContext())
            {
                conferences = ctx.GetXEP0048ConferenceItemsForAccount(client.getXMPPAccount().getBareJid());
            }
            if (updateBookmarksHelper != null)
            {
                updateBookmarksHelper.Dispose();
            }
            updateBookmarksHelper = client.PUB_SUB_COMMAND_HELPER.setBookmars_xep_0048(conferences, OnUpdateBookmarksMessage, OnUpdateBookmarksTimeout);
        }
예제 #11
0
        private void UpdateBookmarks(ChatDataTemplate chat)
        {
            List <ConferenceItem> conferences;

            using (MainDbContext ctx = new MainDbContext())
            {
                conferences = ctx.GetXEP0048ConferenceItemsForAccount(chat.Client.dbAccount.bareJid);
            }
            if (updateBookmarksHelper != null)
            {
                updateBookmarksHelper.Dispose();
            }
            // TODO: Register callbacks for once an error occurred and show a notification to the user
            updateBookmarksHelper = chat.Client.xmppClient.PUB_SUB_COMMAND_HELPER.setBookmars_xep_0048(conferences, null, null);
        }
예제 #12
0
        private void sendDisco(XMPPClient client, MUCRoomInfo info)
        {
            if (info != null && client != null)
            {
                details_itmc.Visibility = Visibility.Collapsed;
                loading_grid.Visibility = Visibility.Visible;

                if (messageResponseHelper != null)
                {
                    messageResponseHelper.Dispose();
                }

                messageResponseHelper = client.MUC_COMMAND_HELPER.requestRoomInfo(info.jid, onMessage, onTimeout);
            }
        }
예제 #13
0
 private void switchMUCBookmarkes()
 {
     if (MUCInfo != null && Chat != null)
     {
         Chat.inRoster = !Chat.inRoster;
         if (updateBookmarkHelper != null)
         {
             updateBookmarkHelper.Dispose();
         }
         ChatDBManager.INSTANCE.setChatTableValue(nameof(Chat.id), Chat.id, nameof(Chat.inRoster), Chat.inRoster);
         setBookarks();
         showChat(Chat);
         showMUCInfo();
     }
 }
예제 #14
0
 //--------------------------------------------------------Events:---------------------------------------------------------------------\\
 #region --Events--
 private void Connection_ConnectionStateChanged(AbstractConnection2 connection, Events.ConnectionStateChangedEventArgs args)
 {
     if (args.newState == ConnectionState.CONNECTED)
     {
         requestDisoInfo();
     }
     else if (args.newState == ConnectionState.DISCONNECTED)
     {
         // Stop message processors:
         if (discoMessageResponseHelper != null)
         {
             discoMessageResponseHelper.Dispose();
             discoMessageResponseHelper = null;
         }
         if (carbonsMessageResponseHelper != null)
         {
             carbonsMessageResponseHelper.Dispose();
             carbonsMessageResponseHelper = null;
         }
     }
 }
예제 #15
0
        private void showResultDisco(ExtendedDiscoResponseMessage disco)
        {
            FIELDS.Clear();
            messageResponseHelper?.Dispose();
            messageResponseHelper = null;

            if (disco != null && disco.roomConfig != null)
            {
                disco.roomConfig.FIELDS.Sort((a, b) => { return(a.type - b.type); });
                foreach (Field f in disco.roomConfig.FIELDS)
                {
                    if (f.type != FieldType.HIDDEN)
                    {
                        FIELDS.Add(new MUCInfoFieldTemplate()
                        {
                            field = f
                        });
                    }
                }
            }

            loading_grid.Visibility = Visibility.Collapsed;
            details_itmc.Visibility = Visibility.Visible;
        }
예제 #16
0
 public void Dispose()
 {
     requestDeviceListHelper?.Dispose();
     requestBundleInfoHelper?.Dispose();
     subscribeToDeviceListHelper?.Dispose();
 }