// // openmapi.org - IRC <--> Jabber bridge - Helper.cs // // (C) 2009 by Johannes Roith // // Author: Johannes Roith // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // namespace Jonfo.Jabber.IRC { using System; using System.Collections.Generic; using jabber; using jabber.client; public static class Helper { static object rosterLock = new object (); // todo public static JID[] GetAvailableJabberBuddies ( RosterManager rman, PresenceManager pman) { List jidList = new List (); lock (rosterLock) { foreach (JID jid in rman) if (pman.IsAvailable (jid)) jidList.Add (jid); } return jidList.ToArray (); } public static string MakeJabberUserName (JID jid) { return jid.User + "@" + jid.Server; } } }