Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
wmorrison #1
Member since Dec 2015 · 50 posts · Location: Kingston, Jamaica
Group memberships: Members
Show profile · Link to this post
Subject: IqFilter in Onlogon Event
Hello,

I am having an issue firing an iqfilter from the onlogon event.  I know my iqfilte settings are correct as it will execute on the streams once logon was done previously at startup of the form.  I would like to login with a special account and do something before logging out.  This is the code for the onlogon event:

  1. var checkUserIdIq = new CheckUserStatusIq
  2. {
  3.     Type = IqType.Get,
  4.     To = _listSystemSettings[0].DomainName,
  5.     CheckUserStatus = new CheckUserStatus { userId = _userId.Text }
  6. };
  7. //Set the type of Stanza
  8. checkUserIdIq.CheckUserStatus.SetAttribute("type", "CHECK");
  9.  
  10. // Send the Stanza to the server using IqFilter
  11. _xmppAdmin.IqFilter.SendIq(checkUserIdIq, UserResponse, "CHECK");

The function "UserResponse" is not firing.  By  the way it doesn't work for OnBind either.

Regards,
Will
This post was edited on 2016-03-29, 11:07 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
when the OnLogin event fires this means you are authenticated.
But the XMPP session is not ready yet, and you have no resource assigned yet. Resources are required for IQs. You have to send your IQs later. I would suggest to wait until you get the first incoming OnPresence event.

Alex
Avatar
wmorrison #3
Member since Dec 2015 · 50 posts · Location: Kingston, Jamaica
Group memberships: Members
Show profile · Link to this post
Will make the adjustment.  Thanks.
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: