/// <summary> /// Add recipient. /// </summary> public void AddPeer(Peer peer) { if (!_peers.Contains(peer._user.Bare)) { _peers.Add(peer._user.Bare); } }
public void TestPeerSendMessage() { var peer = new Peer("*****@*****.**") {Password = "******"}; peer.Login(); peer.AddPeer("*****@*****.**"); peer.SendMessage("message"); peer.Logout(); }
public void TestPeerSendReceiveMessage() { // Peer1. var peer1 = new Peer("*****@*****.**") {Password = "******"}; peer1.Login(); // Peer2. var peer2 = new Peer("*****@*****.**") {Password = "******"}; peer2.Login(); peer2.OnMessage += OnMessage; // Send message. peer1.AddPeer(peer2); peer1.SendMessage("message"); // Logout. peer1.Logout(); peer2.Logout(); }
public void TestPeerLogin() { var peer = new Peer("*****@*****.**") {Password = "******"}; peer.Login(); peer.Logout(); }
public void TestPeerCollection() { var peer = new Peer("*****@*****.**") { Password = "******" }; peer.AddPeer(new[] { "recipient", "recipient", "recipient2", "*****@*****.**" }); }