static gboolean plugin_load(PurplePlugin *plugin) { void *conv_list_handle; PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin); /* First, we have to register our four exported functions with the main purple dbus loop. Without this statement, the purple dbus code wouldn't know about our functions. */ PURPLE_DBUS_REGISTER_BINDINGS(plugin); /* Keep the plugin for reference (needed for notify's) */ plugin_pointer = plugin; /* Add the button to all the current conversations */ purple_conversation_foreach (init_conversation); /* Listen for any new conversations */ conv_list_handle = purple_conversations_get_handle(); purple_signal_connect(conv_list_handle, "conversation-created", plugin, PURPLE_CALLBACK(init_conversation), NULL); /* Listen for conversations that are ending */ purple_signal_connect(conv_list_handle, "deleting-conversation", plugin, PURPLE_CALLBACK(conv_destroyed), NULL); /* Listen for sending/receiving messages to replace tags */ purple_signal_connect(conv_list_handle, "sending-im-msg", plugin, PURPLE_CALLBACK(intercept_sent), NULL); purple_signal_connect(conv_list_handle, "receiving-im-msg", plugin, PURPLE_CALLBACK(intercept_received), NULL); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin); /* First, we have to register our four exported functions with the main purple dbus loop. Without this statement, the purple dbus code wouldn't know about our functions. */ PURPLE_DBUS_REGISTER_BINDINGS(plugin); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin); /* First, we have to register our four exported functions with the main purple dbus loop. Without this statement, the purple dbus code wouldn't know about our functions. */ PURPLE_DBUS_REGISTER_BINDINGS(plugin); /* Then, we register the hello object of type PurpleText. Note that pointer registrations / unregistrations are completely dynamic; they don't have to be made when the plugin is loaded / unloaded. Without this statement the dbus purple code wouldn't know about the hello object. */ PURPLE_DBUS_REGISTER_POINTER(&hello, PurpleText); hello.text = g_strdup("Hello."); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin, GError **error) { void *conv_list_handle; GList *l; PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin); purple_prefs_add_none("/plugins/gtk/musicmessaging"); purple_prefs_add_string("/plugins/gtk/musicmessaging/editor_path", "/usr/bin/gscore"); /* First, we have to register our four exported functions with the main purple dbus loop. Without this statement, the purple dbus code wouldn't know about our functions. */ PURPLE_DBUS_REGISTER_BINDINGS(plugin); /* Keep the plugin for reference (needed for notify's) */ plugin_pointer = plugin; /* Add the button to all the current conversations */ for (l = purple_conversations_get_all(); l != NULL; l = l->next) init_conversation((PurpleConversation *)l->data); /* Listen for any new conversations */ conv_list_handle = purple_conversations_get_handle(); purple_signal_connect(conv_list_handle, "conversation-created", plugin, PURPLE_CALLBACK(init_conversation), NULL); /* Listen for conversations that are ending */ purple_signal_connect(conv_list_handle, "deleting-conversation", plugin, PURPLE_CALLBACK(conv_destroyed), NULL); /* Listen for sending/receiving messages to replace tags */ purple_signal_connect(conv_list_handle, "sending-im-msg", plugin, PURPLE_CALLBACK(intercept_sent), NULL); purple_signal_connect(conv_list_handle, "receiving-im-msg", plugin, PURPLE_CALLBACK(intercept_received), NULL); return TRUE; }