Beispiel #1
0
 private List<Contact> GetGlobalContacts(ContactsFound contactsFound)
 {
     var globalContacts = new List<Contact>();
     foreach (var iUser in contactsFound.Users)
     {
         var user = iUser as User;
         if (user != null)
         {
             globalContacts.Add(new TelegramContact
             {
                 Available = TelegramUtils.GetAvailable(user),
                 LastSeen = TelegramUtils.GetLastSeenTime(user),
                 FirstName = user.FirstName,
                 LastName = user.LastName,
                 User = user,
                 Ids = new List<Contact.ID>
                 {
                     new Contact.ID
                     {
                         Service = this,
                         Id = user.Id.ToString(CultureInfo.InvariantCulture)
                     }
                 },
             });
         }
     }
     return globalContacts;
 }
Beispiel #2
0
 private List<Contact> GetGlobalPartyContacts(ContactsFound contactsFound)
 {
     var globalContacts = new List<Contact>();
     _dialogs.AddChats(contactsFound.Chats);
     Utils.DebugPrint("Chats found " + ObjectDumper.Dump(contactsFound.Chats));
     foreach (var chat in contactsFound.Chats)
     {
         var name = TelegramUtils.GetChatTitle(chat);
         var kicked = TelegramUtils.GetChatKicked(chat);
         if (kicked)
             continue;
         globalContacts.Add(new TelegramPartyContact
         {
             FirstName = name,
             Ids = new List<Contact.ID>
                     {
                         new Contact.PartyID
                         {
                             Service = this,
                             Id = TelegramUtils.GetChatId(chat),
                             ExtendedParty = chat is Channel
                         }
                     },
         });
     }
     return globalContacts;
 }