Registration of <presence/> handler

While we’ve defined the presenceCB() subroutine to handle <presence/> packets, we haven’t actually told the Jabber library about it. The call to the setPresenceHandler() method of the connection object does this for us, performing the “Register handler” step shown in Figure 8-6. The steps shown in Figure 8-6 are described in Section 8.3.4.

con.setPresenceHandler(presenceCB)

Handlers and the relationship between the Jabber library and your script
Figure 8-6. Handlers and the relationship between the Jabber library and your script

Get Programming Jabber now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.