public bool HasFeature(IInterlocutorResource interlocutorResource, string uri) { var client = ModelContext.GetClientByContact(interlocutorResource.Interlocutor); var jid = interlocutorResource.Jid.ToString().ToLower(); var key = new CapsSource(client, jid); CapsInfo capsInfo; if (!_presentCaps.TryGetValue(key, out capsInfo)) { return false; } return _discoveryDataAccess.HasFeature(capsInfo, uri); }
public bool HasFeature(IInterlocutorResource jid, string uri) { return _capsService.HasFeature(jid, uri); }
public InterlocutorResourceItemViewModel(IInterlocutorResource resource) { ResourceItem = resource; resource.SubscribeToChange(() => resource.Show, sender => PropertyChanged.Notify(() => ResourceShow)); }
private void RemoveResourceItem(IInterlocutorResource item) { var toRemove = _interlocutorResources.First(i => i.ResourceItem == item); _interlocutorResources.Remove(toRemove); }
private void CreateResourceItem(IInterlocutorResource item) { var resourceVM = new InterlocutorResourceItemViewModel(item); _interlocutorResources.Add(resourceVM); }
private IInterlocutorResource ReadHistory() { var latest = MessageFeed.GetMessages(Predicate).LastOrDefault(); if (latest == null) { _activeResource = InitResource(); return InitResource(); } var from = latest.XmppMessage.From; var resource = InterlocutorContext.Resources.FirstOrDefault(interlocutorResource => Equals(interlocutorResource.Jid, @from)); return resource; }
public void Consume(IMessage message) { _activeResource = GetActiveResource(message); }
public InterlocutorChatSession(Interlocutor interlocutor) { _interlocutor = interlocutor; _activeResource = ReadHistory(); }