public ICollection <XmppSession> GetBareJidSessions(Jid jid, GetSessionsType getType) { if (jid == null) { return(new List <XmppSession>()); } try { locker.EnterReadLock(); var bares = from s in sessions.Values where s.Jid.Bare == jid.Bare select s; if (getType == GetSessionsType.Available) { bares = from s in bares where s.Available select s; } if (getType == GetSessionsType.RosterRequested) { bares = from s in bares where s.RosterRequested select s; } return(bares.ToList()); } finally { locker.ExitReadLock(); } }
public ICollection <XmppSession> GetBareJidSessions(Jid jid, GetSessionsType getType) { if (jid == null) { return(new XmppSession[0]); } var bares = sessions.Values.Where(s => s.Jid.Bare == jid.Bare); if (getType == GetSessionsType.Available) { bares = bares.Where(s => s.Available); } else if (getType == GetSessionsType.RosterRequested) { bares = bares.Where(s => s.RosterRequested); } return(bares.ToList()); }
public ICollection<XmppSession> GetBareJidSessions(Jid jid, GetSessionsType getType) { if (jid == null) return new List<XmppSession>(); try { locker.EnterReadLock(); var bares = from s in sessions.Values where s.Jid.Bare == jid.Bare select s; if (getType == GetSessionsType.Available) { bares = from s in bares where s.Available select s; } if (getType == GetSessionsType.RosterRequested) { bares = from s in bares where s.RosterRequested select s; } return bares.ToList(); } finally { locker.ExitReadLock(); } }