RegisterCallback callback problems

Patrick Fitzgerald <pfitzgerald-/[email protected]> Thu, 16 Dec 2004 09:16:00 +0000 (GMT)
Newsgroups gmane.network.jabber.exodus.devel
Message-ID <[email protected]>
Hi, 

My scenario is as follows: I have a plugin that needs on occasion to get vcard information about
members of the current roster.

I have added a menu item at startup:

    _mi:=_exodus.addContactMenu('Process this vCard');

In MenuClick I parse the correct menu and ask for the vcard more or less like this:

      jid:=_exodus.getActiveContact;
      _cb:=_exodus.RegisterCallback('/packet', Self);
      _exodus.Send('<iq to="'+jid+'" type="get"><vCard xmlns="vcard-temp"/></iq>');

then in Process() I process the result, for example,

    _exodus.showToast('Call Back Received:'+xml,0,1);

THEN I want the call back to go away until I need the vcard of another user, because my plugin has
to do other things - it cant wait.

    if (_cb >= 0) then  _exodus.UnRegisterCallback(_cb);

BUT it doesnt. I continue to get callbacks until I terminate the application. Am I going about
this the wrong way? Or is it a bug?

Thanks in advance...

Patrick 


	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com