Beispiel #1
0
/* register "sending" message signal callback */
static gboolean
plugin_load(PurplePlugin *plugin) {
	purple_signal_connect_priority(purple_conversations_get_handle(),
			    "sending-im-msg",
			    plugin,
			    PURPLE_CALLBACK(sending_im_msg_cb),
			    NULL,
				PURPLE_SIGNAL_PRIORITY_HIGHEST);
	purple_signal_connect_priority(purple_conversations_get_handle(),
			    "sending-chat-msg",
			    plugin,
			    PURPLE_CALLBACK(sending_chat_msg_cb),
			    NULL,
				PURPLE_SIGNAL_PRIORITY_HIGHEST);

	return TRUE;
}
Beispiel #2
0
static gboolean
plugin_load(PurplePlugin *plugin)
{
	void *conv_handle = purple_conversations_get_handle();
	void *gtkconv_handle = pidgin_conversations_get_handle();

	/* lower priority to display initial timestamp after logged messages */
	purple_signal_connect_priority(conv_handle, "conversation-created",
		plugin, PURPLE_CALLBACK(timestamp_new_convo), NULL,
		PURPLE_SIGNAL_PRIORITY_DEFAULT + 1);

	purple_signal_connect(gtkconv_handle, "displaying-chat-msg",
		plugin, PURPLE_CALLBACK(timestamp_displaying_conv_msg), NULL);
	purple_signal_connect(gtkconv_handle, "displaying-im-msg",
		plugin, PURPLE_CALLBACK(timestamp_displaying_conv_msg), NULL);

	interval = purple_prefs_get_int("/plugins/gtk/timestamp/interval") / 1000;

	return TRUE;
}
Beispiel #3
0
/*------------------------------------------------------------------------
 * Enable some signals to handled by our plugin
 *
 *  @param session			The MXit session object
 */
void mxit_enable_signals( struct MXitSession* session )
{
	/* enable the signal when a new conversation is opened by the user */
	purple_signal_connect_priority( purple_conversations_get_handle(), "conversation-created", session, PURPLE_CALLBACK( mxit_cb_chat_created ),
			session, PURPLE_SIGNAL_PRIORITY_HIGHEST );
}
Beispiel #4
0
static gboolean load_plugin(PurplePlugin *plugin)
{
    purple_signal_register(plugin, "jabber-receiving-xmlnode",
                           purple_marshal_VOID__POINTER_POINTER, NULL, 2,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new_outgoing(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_XMLNODE));

    purple_signal_register(plugin, "jabber-sending-xmlnode",
                           purple_marshal_VOID__POINTER_POINTER, NULL, 2,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new_outgoing(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_XMLNODE));

    /*
     * Do not remove this or the plugin will fail. Completely. You have been
     * warned!
     */
    purple_signal_connect_priority(plugin, "jabber-sending-xmlnode",
                                   plugin, PURPLE_CALLBACK(jabber_send_signal_cb),
                                   NULL, PURPLE_SIGNAL_PRIORITY_HIGHEST);

    purple_signal_register(plugin, "jabber-sending-text",
                           purple_marshal_VOID__POINTER_POINTER, NULL, 2,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new_outgoing(PURPLE_TYPE_STRING));

    purple_signal_register(plugin, "jabber-receiving-message",
                           purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER_POINTER,
                           purple_value_new(PURPLE_TYPE_BOOLEAN), 6,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new(PURPLE_TYPE_STRING), /* type */
                           purple_value_new(PURPLE_TYPE_STRING), /* id */
                           purple_value_new(PURPLE_TYPE_STRING), /* from */
                           purple_value_new(PURPLE_TYPE_STRING), /* to */
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_XMLNODE));

    purple_signal_register(plugin, "jabber-receiving-iq",
                           purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
                           purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new(PURPLE_TYPE_STRING), /* type */
                           purple_value_new(PURPLE_TYPE_STRING), /* id */
                           purple_value_new(PURPLE_TYPE_STRING), /* from */
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_XMLNODE));

    purple_signal_register(plugin, "jabber-watched-iq",
                           purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
                           purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new(PURPLE_TYPE_STRING), /* type */
                           purple_value_new(PURPLE_TYPE_STRING), /* id */
                           purple_value_new(PURPLE_TYPE_STRING), /* from */
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_XMLNODE)); /* child */

    /* Modifying these? Look at jabber_init_plugin for the ipc versions */
    purple_signal_register(plugin, "jabber-register-namespace-watcher",
                           purple_marshal_VOID__POINTER_POINTER,
                           NULL, 2,
                           purple_value_new(PURPLE_TYPE_STRING),  /* node */
                           purple_value_new(PURPLE_TYPE_STRING)); /* namespace */

    purple_signal_register(plugin, "jabber-unregister-namespace-watcher",
                           purple_marshal_VOID__POINTER_POINTER,
                           NULL, 2,
                           purple_value_new(PURPLE_TYPE_STRING),  /* node */
                           purple_value_new(PURPLE_TYPE_STRING)); /* namespace */

    purple_signal_connect(plugin, "jabber-register-namespace-watcher",
                          plugin, PURPLE_CALLBACK(jabber_iq_signal_register), NULL);
    purple_signal_connect(plugin, "jabber-unregister-namespace-watcher",
                          plugin, PURPLE_CALLBACK(jabber_iq_signal_unregister), NULL);

    purple_signal_register(plugin, "jabber-receiving-presence",
                           purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER,
                           purple_value_new(PURPLE_TYPE_BOOLEAN), 4,
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_CONNECTION),
                           purple_value_new(PURPLE_TYPE_STRING), /* type */
                           purple_value_new(PURPLE_TYPE_STRING), /* from */
                           purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_XMLNODE));

    return TRUE;
}