Exemple #1
0
        private void CLIENT_NewDiscoResponseMessage(XMPPClient client, XMPP_API.Classes.Network.Events.NewDiscoResponseMessageEventArgs args)
        {
            Task.Run(async() =>
            {
                string from = args.DISCO.getFrom();
                // Only store direct server results:
                if (from != null && !from.Contains("@") && messageIdCache.getTimed(args.DISCO.ID) != null)
                {
                    switch (args.DISCO.DISCO_TYPE)
                    {
                    case DiscoType.ITEMS:
                        await addItemsAsync(args.DISCO.ITEMS, from, client, true);
                        break;

                    case DiscoType.INFO:
                        addFeatures(args.DISCO.FEATURES, from);
                        addIdentities(args.DISCO.IDENTITIES, from);
                        break;

                    default:
                        throw new InvalidOperationException("Unexpected value for DISCO_TYPE: " + args.DISCO.DISCO_TYPE);
                    }
                }
            });
        }
Exemple #2
0
 //--------------------------------------------------------Events:---------------------------------------------------------------------\\
 #region --Events--
 private void Client_NewDiscoResponseMessage(XMPPClient client, XMPP_API.Classes.Network.Events.NewDiscoResponseMessageEventArgs args)
 {
     if (discoInfosId != null && string.Equals(discoInfosId, args.DISCO.ID))
     {
         stopTimerInfos();
         Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => showResultDisco(args.DISCO)).AsTask();
     }
     else if (discoItemsId != null && string.Equals(discoItemsId, args.DISCO.ID))
     {
         stopTimerItems();
         Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => showResultDisco(args.DISCO)).AsTask();
     }
 }