public void TestInvite() { XMPPClient ObjXmppClient = new XMPPClient(); //initializing the xmpp client with credentials ObjXmppClient.JID = "*****@*****.**"; ObjXmppClient.Password = "******"; ObjXmppClient.Server = "54.173.99.54"; ObjXmppClient.AutoReconnect = true; ObjXmppClient.RetrieveRoster = true; ObjXmppClient.PresenceStatus = new PresenceStatus() { PresenceType = PresenceType.available, IsOnline = true }; ObjXmppClient.AutoAcceptPresenceSubscribe = true; ObjXmppClient.AttemptReconnectOnBadPing = true; // XMPPConnection ObjXmppCon = new XMPPConnection(ObjXmppClient); ObjXmppCon = new XMPPConnection(ObjXmppClient); ObjXmppCon.Connect(); ObjXmppClient.Connect(); //muc manager test MucManager mucManager = new MucManager(ObjXmppClient); JID roomJID = "*****@*****.**"; mucManager.EnterRoom(roomJID, "XMPPTestNickName"); JID to = "*****@*****.**"; mucManager.DirectInvite(to, roomJID); }
private static XMPPConnection ConnectTo(String hostname, String username, String password) { XMPPConnection connection = XMPPConnection.CreateXMPPConnection(hostname); connection.Connect(); connection.Login(username, password, AUCTION_RESOURCE); return(connection); }
public void TestConnection() { XMPPClient xmppClient = new XMPPClient(); xmppClient.UserName = "******"; xmppClient.JID = "*****@*****.**"; xmppClient.Server = "192.168.1.29s"; xmppClient.Password = "******"; XMPPConnection xmppConnection = new XMPPConnection(xmppClient); bool connectionStatus = xmppConnection.Connect(); //Assert.Equals(connectionStatus, true); }
public void Main(string xmppHostName, string sniperId, string sniperPassword, string itemId) { _xmppHostName = xmppHostName; _sniperId = sniperId; _sniperPassword = sniperPassword; _itemId = itemId; PickerMainView.WindowTitle = SharedConstants.MAIN_WINDOW_TITLE; XMPPConnection connection = ConnectTo(_xmppHostName, _sniperId, _sniperPassword); JoinAuction(connection, itemId); }
private void JoinAuction(XMPPConnection connection, string itemId) { string formattedAuctionId = AuctionId(itemId, connection); Chat chat = connection.ChatManager.CreateChat(formattedAuctionId, null); const int BID_AMOUNT = 35; IAuction auction = new XMPPAuction(chat); chat.AddIMessageListener( new AuctionMessageTranslator( connection.UserName, new Domain.AuctionSniper(auction, new SniperStateDisplayer(this)))); auction.Join(); }
public FakeAuctionServer(String itemId) { _itemId = itemId; _connection = XMPPConnection.CreateXMPPConnection(SharedConstants.XMPP_HOSTNAME); }
private static string AuctionId(String itemId, XMPPConnection connection) { return(string.Format(AUCTION_ID_FORMAT, itemId, connection.ServiceName)); }