RegisterCallback callback problems

Patrick Fitzgerald <pfitzgerald-/[email protected]> Fri, 17 Dec 2004 13:09:17 +0000 (GMT)
Newsgroups gmane.network.jabber.exodus.devel
Message-ID <[email protected]>
Peter,

Thanks - I thought there was bound to be a better way to get the vcard only. I didnt think that
the callback shold wait either - perhaps I coded it wrongly in the first place. But the callbacks
seem not to unregistering, but this is not so important now that I can extract the vcard info.

I have noticed that the way Exodus handles vCards exludes Mobile and Pager numbers - where as
Jabber Instant Messenger includes these. Is there a reason for this? 

Also, if I have created my own vCard in J.I.M., and edit it in Exodus, those same extra attributes
are removed from the server stored copy. It would be good if they stayed put even if they couldn't
be edited...


Patrick Fitzgerald wrote:
> 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?

A quick glance at the code shows the right thing is supposed to be happening.. I
don't have time at this moment to debug/test. I'm also confused by what you said
above: "it can't wait".. Leaving a callback in place doesn't not block operation
of your plugin in any way.

Also, you may consider using a more filtered callback, like:

_cb:=_exodus.RegisterCallback('/packet/iq/vCard[@xmlns="vcard-temp"]', Self);

By using just /packet, you are getting every single packet that flows through
the client, which isn't the most efficient thing. It also means you have to do
more work inside your Process() event to check to see if it's a packet your
interested in.

I'll get a chance this wknd to test unregistering callbacks to make sure it's
working properly.

pgm.





		
___________________________________________________________ 
Win a castle for NYE with your mates and Yahoo! Messenger 
http://uk.messenger.yahoo.com