public async Task SendPresenceAsync() { var pres = new Presence(); pres.Add(clientCaps.ClientCapabilities); await xmppClient.SendPresenceAsync(pres); }
public async Task SendPresenceAsync(ViewModel.OnlineStatus status) { var pres = new Presence { Show = mapper.Map <Matrix.Xmpp.Show>(status) }; pres.Add(clientCaps.ClientCapabilities); await xmppClient.SendPresenceAsync(pres); }
public Presence CreateEnterRoomStanza(Jid room, string nickname, string password = null, bool disableHistory = false, History history = null) { var to = new Jid(room.ToString()) { Resource = nickname }; var pres = new Presence { To = to }; var x = new X(); if (password != null) { x.Password = password; } if (disableHistory) { var hist = new History { MaxCharacters = 0 }; x.History = hist; } if (history != null) { x.History = history; } pres.Add(x); return(pres); }
public async Task JoinRoom(string roomJid) { string nickname; bool found = Config.GetString("JABBER_NICKNAME", out nickname); if (!found) { nickname = "Sansha_Kuvakei"; } Jid to = new Jid(roomJid) { Resource = nickname }; Presence p = new Presence() { To = to }; p.Nick = new Matrix.Xmpp.Nickname.Nick(nickname); var x = new X(); x.History = new History(); // Suppress history, we don't want to process old messages x.History.MaxStanzas = 0; p.Add(x); AddRoom(to.User); await m_client.SendAsync(p); Console.WriteLine("[Info] Joined room {0}", roomJid); }
public static void AddPresence(common.Presence t) { Presence presence = Mapper.Casting(t); Presence.Add(presence); }