Subject: Vb.Net Event not fired!
In the below code, OnAuthError or OnLogin events are not fired!
Any help is welcome.
Any help is welcome.
- Public Property IsLoggedIn As Boolean
- Private objXmpp As agsXMPP.XmppClientConnection
- Public Sub Googlelogin(ByVal GmailID As String, ByVal GmailPass As String)
- Dim jid As agsXMPP.Jid
- objXmpp.Password = GmailPass
- objXmpp.Username = jid.User
- objXmpp.Server = jid.Server
- objXmpp.AutoResolveConnectServer = True
- Try
- AddHandler objXmpp.OnAuthError, AddressOf loginFailed
- AddHandler objXmpp.OnLogin, AddressOf loggedIn
- objXmpp.Open()
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
- End Sub
- Public Sub GoogleLogout()
- objXmpp.Close()
- End Sub
- Private Sub loginFailed()
- IsLoggedIn = False
- End Sub
- Private Sub loggedIn()
- IsLoggedIn = True
- End Sub
- Public Function SendHangout(ByVal GoogleId As String, ByVal Message As String) As Boolean
- If Not IsLoggedIn Then
- SendHangout = False
- Exit Function
- End If
- Dim jid As agsXMPP.Jid = Nothing
- Dim autoReply As agsXMPP.protocol.client.Message = Nothing
- autoReply = New agsXMPP.protocol.client.Message(jid, agsXMPP.protocol.client.MessageType.chat, Message)
- objXmpp.Send(autoReply)
- SendHangout = True
- End Function