-def conv_callback(name):
- print "---- conversation callback example: %s" % name
-
-conv_cbs["create_conversation"] = conv_callback
-conv_cbs["destroy_conversation"] = conv_callback
-conv_cbs["write_chat"] = conv_callback
-conv_cbs["write_im"] = conv_callback
-conv_cbs["write_conv"] = conv_callback
-conv_cbs["chat_add_users"] = conv_callback
-conv_cbs["chat_rename_user"] = conv_callback
-conv_cbs["chat_remove_users"] = conv_callback
-conv_cbs["chat_update_user"] = conv_callback
-conv_cbs["present"] = conv_callback
-conv_cbs["has_focus"] = conv_callback
-conv_cbs["custom_smiley_add"] = conv_callback
-conv_cbs["custom_smiley_write"] = conv_callback
-conv_cbs["custom_smiley_close"] = conv_callback
-conv_cbs["send_confirm"] = conv_callback
-
-cbs["conversation"] = conv_cbs
-
-class NullClient:
- def __init__(self):
- self.p = purple.Purple()
- self.account = None
-
- def execute(self):
- global cbs
- self.p.purple_init(cbs)
-
- def set_protocol(self, protocol):
- for i in self.p.get_protocols():
- if i[1] == protocol:
- print "-- NULLCLIENT --: Choosing %s as protocol" % protocol
- self.protocol = i[0]
- print "-- NULLCLIENT --: Protocol successfully chosen: %s" % i[0]
- return