public void HandleAuthorizationsRequest(VsJid id) { var to = XmppIdConverter.Convert(id); var name = GetInterlocutor(id).Name; _queue.PushToFront(new AuthorizationRequestMessage( name, () => _presenceManager.ApproveSubscriptionRequest(to), () => _presenceManager.RefuseSubscriptionRequest(to))); }
public Interlocutor GetContactById(VsJid id) { return _account.XmppClients.SelectMany(client => client.Contacts) .FirstOrDefault(client => client.Id == id); }
public Client GetClientById(VsJid id) { return _account.XmppClients.FirstOrDefault(client => client.Id == id); }
public bool Contains(VsJid id) { return _client.Contacts.Any(contact => contact.Id == id); }
public void RemoveInterlocutor(VsJid id) { var targetContact = _client.Contacts.First(contact => contact.Id == id); _client.Contacts.Remove(targetContact); }
public static Jid Convert(VsJid id) { return new Jid(id.Jid); }
protected bool Equals(VsJid other) { return string.Equals(_jid, other._jid, StringComparison.InvariantCultureIgnoreCase); }
private Interlocutor GetInterlocutor(VsJid id) { return _client.Contacts.First(contact => contact.Id == id); }
public void PushAuthorizationsRequest(VsJid id) { var to = XmppIdConverter.Convert(id); _presenceManager.Subscribe(to); }
protected bool Equals(VsJid other) { return(string.Equals(_jid, other._jid, StringComparison.InvariantCultureIgnoreCase)); }
private IContact GetInterlocutorOrSelf(VsJid id) { if (_client.Id == id) return new ClientStub(_client); return new InterlocutorStub(_client.Contacts.First(contact => contact.Id == id)); }
public void UpdatedImName(VsJid id, string name) { GetInterlocutorOrSelf(id).ImName = name; }
public void RequestsAuthorization(VsJid id) { _provider.HandleAuthorizationsRequest(id); }
public void ChangedState(VsJid id, ContactState state) { GetInterlocutorOrSelf(id).State = state; }