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)));
 }
Beispiel #2
0
 public Interlocutor GetContactById(VsJid id)
 {
     return _account.XmppClients.SelectMany(client => client.Contacts)
         .FirstOrDefault(client => client.Id == id);
 }
Beispiel #3
0
 public Client GetClientById(VsJid id)
 {
     return _account.XmppClients.FirstOrDefault(client => client.Id == id);
 }
Beispiel #4
0
 public bool Contains(VsJid id)
 {
     return _client.Contacts.Any(contact => contact.Id == id);
 }
Beispiel #5
0
 public void RemoveInterlocutor(VsJid id)
 {
     var targetContact = _client.Contacts.First(contact => contact.Id == id);
     _client.Contacts.Remove(targetContact);
 }
Beispiel #6
0
 public static Jid Convert(VsJid id)
 {
     return new Jid(id.Jid);
 }
Beispiel #7
0
 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);
 }
Beispiel #10
0
 protected bool Equals(VsJid other)
 {
     return(string.Equals(_jid, other._jid, StringComparison.InvariantCultureIgnoreCase));
 }
Beispiel #11
0
 private IContact GetInterlocutorOrSelf(VsJid id)
 {
     if (_client.Id == id) return new ClientStub(_client);
     return new InterlocutorStub(_client.Contacts.First(contact => contact.Id == id));
 }
Beispiel #12
0
 public void UpdatedImName(VsJid id, string name)
 {
     GetInterlocutorOrSelf(id).ImName = name;
 }
Beispiel #13
0
 public void RequestsAuthorization(VsJid id)
 {
     _provider.HandleAuthorizationsRequest(id);
 }
Beispiel #14
0
 public void ChangedState(VsJid id, ContactState state)
 {
     GetInterlocutorOrSelf(id).State = state;
 }