Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
ackid32 #1
Member since Jul 2015 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Vb.Net Event not fired!
In the below code, OnAuthError or OnLogin events are not fired!

Any help is welcome.

  1. Public Property IsLoggedIn As Boolean
  2. Private objXmpp As agsXMPP.XmppClientConnection
  3.  
  4. Public Sub Googlelogin(ByVal GmailID As String, ByVal GmailPass As String)
  5.     objXmpp = New agsXMPP.XmppClientConnection
  6.  
  7.     Dim jid As agsXMPP.Jid
  8.     jid = New agsXMPP.Jid(GmailID)
  9.     objXmpp.Password = GmailPass
  10.     objXmpp.Username = jid.User
  11.     objXmpp.Server = jid.Server
  12.     objXmpp.AutoResolveConnectServer = True
  13.     Try
  14.         AddHandler objXmpp.OnAuthError, AddressOf loginFailed
  15.         AddHandler objXmpp.OnLogin, AddressOf loggedIn
  16.         objXmpp.Open()
  17.     Catch ex As Exception
  18.         MsgBox(ex.Message)
  19.     End Try
  20. End Sub
  21.  
  22. Public Sub GoogleLogout()
  23.     objXmpp.Close()
  24. End Sub
  25.  
  26. Private Sub loginFailed()
  27.     IsLoggedIn = False
  28. End Sub
  29.  
  30. Private Sub loggedIn()
  31.     IsLoggedIn = True
  32. End Sub
  33.  
  34. Public Function SendHangout(ByVal GoogleId As String, ByVal Message As String) As Boolean
  35.  
  36.     If Not IsLoggedIn Then
  37.         SendHangout = False
  38.         Exit Function
  39.     End If
  40.  
  41.     Dim jid As agsXMPP.Jid = Nothing
  42.     Dim autoReply As agsXMPP.protocol.client.Message = Nothing
  43.  
  44.     jid = New agsXMPP.Jid(GoogleId)
  45.     autoReply = New agsXMPP.protocol.client.Message(jid, agsXMPP.protocol.client.MessageType.chat, Message)
  46.     objXmpp.Send(autoReply)
  47.     SendHangout = True
  48. End Function
This post was edited on 2015-07-09, 17:17 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Add the handlers for the debug XML and post it here please.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS