/// <summary> /// Updates the list. /// </summary> /// <param name="removed">if set to <c>true</c> the item will be removed.</param> /// <param name="item">The item to update.</param> public void UpdateList(bool removed, S22.Xmpp.Im.RosterItem item) { if (removed) { UICollection.AddOnUI(AllContacts, item); } else { UICollection.RemoveOnUI(AllContacts, item); } }
/// <summary> /// Gets a user or create it based on its JID. /// </summary> /// <param name="jid">The jid.</param> /// <returns>A user in the Contact List.</returns> public Models.UserViewModel GetUser(Jid jid) { foreach (var contact in AllContacts) { if (jid.GetBareJid() == contact.Jid.GetBareJid()) { return(contact); } } // Create a temporary contact if a non-roster user creates a conversation. // Allows administrator to talk to anyone. // Change ctor in user var tempContact = new Models.UserViewModel(jid, ""); UICollection.AddOnUI(AllContacts, tempContact); return(tempContact); }
/// <summary> /// Adds the message received. Called by external thread. /// </summary> /// <param name="message">The message.</param> internal void AddMessage(Message message) { // Call to dispatcher to trigger OnCollectionChanged UICollection.AddOnUI(Messages, message); }