public Vcard Get(string username) { Vcard vcard = null; using (SqlDataContext dc = new SqlDataContext()) { try { var user = dc.DatabaseUserItems.Single(x => string.Compare(username, x.Username, true) == 0); var data = HeaderManager.Load(username); vcard = new Vcard(); vcard.Nickname = user.Nickname; vcard.Description = user.Signature; vcard.Jid = JIDEscaping.Escape(user.Username) + "@gjtalk.com"; vcard.AddEmail(new Email(user.Mail)); if (data != null) { vcard.Photo = new Photo(data, ImageFormat.Png); } } catch (System.Exception ex) { } } return(vcard); }
public RosterItem ToRosterItem() { return(new RosterItem(JIDEscaping.Escape(Username) + "@gjtalk.com", Remark == null ? Nickname : Remark, GroupName)); }