//--------------------------------------------------------Events:---------------------------------------------------------------------\\ #region --Events-- private void accountSelection_asc_AddAccountClicked(object sender, object args) { if (setBookmarkHelper != null) { setBookmarkHelper.Dispose(); setBookmarkHelper = null; } Hide(); }
//--------------------------------------------------------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; }
private void reload() { reload_btn.IsEnabled = false; retry_btn.IsEnabled = false; messageResponseHelper?.Dispose(); messageResponseHelper = null; requestRoomInfo(); }
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); }
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); }
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); }
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); }
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); } }
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(); } }
//--------------------------------------------------------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; } } }
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; }
public void Dispose() { requestDeviceListHelper?.Dispose(); requestBundleInfoHelper?.Dispose(); subscribeToDeviceListHelper?.Dispose(); }