changeset 19647:425010370845

Catch the event at the very end to make sure other plugins can play with it before we do, if they want to.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 04 Sep 2007 21:00:24 +0000
parents 55d3f1622cf7
children 33ccac7fd32b
files libpurple/plugins/offlinemsg.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/offlinemsg.c	Tue Sep 04 19:00:57 2007 +0000
+++ b/libpurple/plugins/offlinemsg.c	Tue Sep 04 21:00:24 2007 +0000
@@ -113,6 +113,10 @@
 	PurpleConversation *conv;
 	OfflineMessageSetting setting;
 
+	if (message == NULL || *message == NULL ||
+			**message == '\0')
+		return;
+
 	buddy = purple_find_buddy(account, who);
 	if (!buddy)
 		return;
@@ -167,8 +171,8 @@
 static gboolean
 plugin_load(PurplePlugin *plugin)
 {
-	purple_signal_connect(purple_conversations_get_handle(), "sending-im-msg",
-					plugin, PURPLE_CALLBACK(sending_msg_cb), plugin);
+	purple_signal_connect_priority(purple_conversations_get_handle(), "sending-im-msg",
+					plugin, PURPLE_CALLBACK(sending_msg_cb), plugin, PURPLE_SIGNAL_PRIORITY_HIGHEST);
 	return TRUE;
 }