changeset 22782:a95fcf01f72c

merge of '0e779a37ee17a7bb7ad39bbe2b37eeca45975655' and '52c0efb045580dac7b6f5e40c91002e917e0cae3'
author Mark Doliner <mark@kingant.net>
date Tue, 29 Apr 2008 03:14:55 +0000
parents 2404b13940e9 (current diff) f1a4ad1526a2 (diff)
children f160d3f5e070
files libpurple/protocols/jabber/presence.c
diffstat 13 files changed, 63 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Tue Apr 29 02:06:03 2008 +0000
+++ b/ChangeLog.API	Tue Apr 29 03:14:55 2008 +0000
@@ -1,6 +1,10 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
-version 2.x.x:
+version 2.5.0:
+    libpurple:
+        Added:
+        * purple_serv_got_join_chat_failed
+        * chat-join-failed signal (see conversation-signals.dox)
 	perl:
 		Added:
 		* Purple::Prefs::get_children_names.
--- a/configure.ac	Tue Apr 29 02:06:03 2008 +0000
+++ b/configure.ac	Tue Apr 29 03:14:55 2008 +0000
@@ -43,19 +43,19 @@
 #
 # Make sure to update finch/libgnt/configure.ac with libgnt version changes.
 #
-m4_define([purple_lt_current], [4])
+m4_define([purple_lt_current], [5])
 m4_define([purple_major_version], [2])
-m4_define([purple_minor_version], [4])
-m4_define([purple_micro_version], [2])
+m4_define([purple_minor_version], [5])
+m4_define([purple_micro_version], [0])
 m4_define([purple_version_suffix], [devel])
 m4_define([purple_version],
           [purple_major_version.purple_minor_version.purple_micro_version])
 m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix]))
 
-m4_define([gnt_lt_current], [4])
+m4_define([gnt_lt_current], [5])
 m4_define([gnt_major_version], [2])
-m4_define([gnt_minor_version], [4])
-m4_define([gnt_micro_version], [2])
+m4_define([gnt_minor_version], [5])
+m4_define([gnt_micro_version], [0])
 m4_define([gnt_version_suffix], [devel])
 m4_define([gnt_version],
           [gnt_major_version.gnt_minor_version.gnt_micro_version])
--- a/doc/conversation-signals.dox	Tue Apr 29 02:06:03 2008 +0000
+++ b/doc/conversation-signals.dox	Tue Apr 29 03:14:55 2008 +0000
@@ -27,6 +27,7 @@
   @signal chat-invited-user
   @signal chat-invited
   @signal chat-joined
+  @signal chat-join-failed
   @signal chat-left
   @signal chat-topic-changed
   @signal conversation-extended-menu
@@ -400,6 +401,16 @@
   @param conv The conversation that joined the chat room.
  @endsignaldef
 
+ @signaldef chat-join-failed
+  @signalproto
+void (*chat_join_failed)(PurpleConnection *gc, const char *name);
+  @endsignalproto
+  @signaldesc
+   Emitted when an account fails to join a chat room
+  @param gc The PurpleConnection of the account which failed to join the chat.
+  @param name The name of the chat.
+ @endsignaldef
+ 
  @signaldef chat-left
   @signalproto
 void (*chat_left)(PurpleConversation *conv);
--- a/doc/finch.1.in	Tue Apr 29 02:06:03 2008 +0000
+++ b/doc/finch.1.in	Tue Apr 29 03:14:55 2008 +0000
@@ -111,9 +111,12 @@
 .B Alt \+ Shift \+ Tab
 Jump to the previous URGENT (highlighted) window.
 .TP
-.B Ctrl \+ o
+.B Ctrl \+ o \fR or \fB F10
 Bring up the menu (if there is one) for a window.
 .TP
+.B F11
+Popup the context menu (if there is one) for the selected widget.
+.TP
 .B Alt \+ /
 Show a list of available key-bindings for the current widget in focus.
 .TP
--- a/finch/libgnt/gntws.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/finch/libgnt/gntws.c	Tue Apr 29 03:14:55 2008 +0000
@@ -13,7 +13,8 @@
 	GntNode *node = g_hash_table_lookup(nodes, widget);
 	if (GNT_IS_WINDOW(widget))
 		gnt_window_workspace_hiding(GNT_WINDOW(widget));
-	hide_panel(node->panel);
+	if (node)
+		hide_panel(node->panel);
 }
 
 static void
--- a/libpurple/conversation.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/conversation.c	Tue Apr 29 03:14:55 2008 +0000
@@ -2368,6 +2368,12 @@
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
 										PURPLE_SUBTYPE_CONVERSATION));
 
+	purple_signal_register(handle, "chat-join-failed",
+						   purple_marshal_VOID__POINTER_POINTER, NULL, 2,
+						   purple_value_new(PURPLE_TYPE_SUBTYPE,
+										PURPLE_SUBTYPE_CONNECTION),
+						   purple_value_new(PURPLE_TYPE_STRING));
+
 	purple_signal_register(handle, "chat-left",
 						 purple_marshal_VOID__POINTER, NULL, 1,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
--- a/libpurple/protocols/jabber/chat.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/protocols/jabber/chat.c	Tue Apr 29 03:14:55 2008 +0000
@@ -222,33 +222,39 @@
 	if(!handle)
 		handle = js->user->node;
 
+	tmp = g_strdup_printf("%s@%s", room, server);
+	room_jid = g_strdup(jabber_normalize(NULL, tmp));
+	g_free(tmp);
+
 	if(!jabber_nodeprep_validate(room)) {
 		char *buf = g_strdup_printf(_("%s is not a valid room name"), room);
 		purple_notify_error(gc, _("Invalid Room Name"), _("Invalid Room Name"),
 				buf);
+		purple_serv_got_join_chat_failed(gc, room_jid);
+		g_free(room_jid);
 		g_free(buf);
 		return;
 	} else if(!jabber_nameprep_validate(server)) {
 		char *buf = g_strdup_printf(_("%s is not a valid server name"), server);
 		purple_notify_error(gc, _("Invalid Server Name"),
 				_("Invalid Server Name"), buf);
+		purple_serv_got_join_chat_failed(gc, room_jid);
+		g_free(room_jid);
 		g_free(buf);
 		return;
 	} else if(!jabber_resourceprep_validate(handle)) {
 		char *buf = g_strdup_printf(_("%s is not a valid room handle"), handle);
 		purple_notify_error(gc, _("Invalid Room Handle"),
 				_("Invalid Room Handle"), buf);
+		purple_serv_got_join_chat_failed(gc, room_jid);
 		g_free(buf);
+		g_free(room_jid);
 		return;
 	}
 
 	if(jabber_chat_find(js, room, server))
 		return;
 
-	tmp = g_strdup_printf("%s@%s", room, server);
-	room_jid = g_strdup(jabber_normalize(NULL, tmp));
-	g_free(tmp);
-
 	chat = g_new0(JabberChat, 1);
 	chat->js = gc->proto_data;
 
--- a/libpurple/protocols/jabber/presence.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/protocols/jabber/presence.c	Tue Apr 29 03:14:55 2008 +0000
@@ -587,6 +587,7 @@
 					serv_got_chat_left(js->gc, chat->id);
 			} else {
 				title = g_strdup_printf(_("Error joining chat %s"), from);
+				purple_serv_got_join_chat_failed(js->gc, room_jid);
 			}
 			purple_notify_error(js->gc, title, title, msg);
 			g_free(title);
--- a/libpurple/protocols/oscar/family_admin.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/protocols/oscar/family_admin.c	Tue Apr 29 03:14:55 2008 +0000
@@ -120,10 +120,6 @@
  * Subtype 0x0004 - Set screenname formatting.
  *
  */
-/*
- * Subtype 0x0004 - Set screenname formatting.
- *
- */
 int
 aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick)
 {
--- a/libpurple/protocols/oscar/misc.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/protocols/oscar/misc.c	Tue Apr 29 03:14:55 2008 +0000
@@ -74,7 +74,7 @@
 
 	byte_stream_put32(&bs, *longdata);
 
-	flap_connection_send_snac(od, conn, family, subtype, 0x0000, snacid, NULL);
+	flap_connection_send_snac(od, conn, family, subtype, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
 }
@@ -97,7 +97,7 @@
 
 	byte_stream_put16(&bs, *shortdata);
 
-	flap_connection_send_snac(od, conn, family, subtype, 0x0000, snacid, NULL);
+	flap_connection_send_snac(od, conn, family, subtype, 0x0000, snacid, &bs);
 
 	byte_stream_destroy(&bs);
 }
--- a/libpurple/prpl.h	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/prpl.h	Tue Apr 29 03:14:55 2008 +0000
@@ -186,7 +186,7 @@
  * A protocol plugin information structure.
  *
  * Every protocol plugin initializes this structure. It is the gateway
- * between purple and the protocol plugin.  Many of this callbacks can be
+ * between purple and the protocol plugin.  Many of these callbacks can be
  * NULL.  If a callback must be implemented, it has a comment indicating so.
  */
 struct _PurplePluginProtocolInfo
--- a/libpurple/server.c	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/server.c	Tue Apr 29 03:14:55 2008 +0000
@@ -967,6 +967,12 @@
 	purple_signal_emit(purple_conversations_get_handle(), "chat-left", conv);
 }
 
+void purple_serv_got_join_chat_failed(PurpleConnection *gc, const char *name)
+{
+	purple_signal_emit(purple_conversations_get_handle(), "chat-join-failed",
+					gc, name);
+}
+
 void serv_got_chat_in(PurpleConnection *g, int id, const char *who,
 					  PurpleMessageFlags flags, const char *message, time_t mtime)
 {
--- a/libpurple/server.h	Tue Apr 29 02:06:03 2008 +0000
+++ b/libpurple/server.h	Tue Apr 29 03:14:55 2008 +0000
@@ -166,6 +166,15 @@
 
 PurpleConversation *serv_got_joined_chat(PurpleConnection *gc,
 									   int id, const char *name);
+/**
+ * Called by a prpl when an attempt to join a chat via serv_join_chat()
+ * fails.
+ *
+ * @param gc      The connection on which chat joining failed
+ * @param name    The name of the chat which we did not join
+ */
+void purple_serv_got_join_chat_failed(PurpleConnection *gc, const char *name);
+	
 void serv_got_chat_left(PurpleConnection *g, int id);
 void serv_got_chat_in(PurpleConnection *g, int id, const char *who,
 					  PurpleMessageFlags flags, const char *message, time_t mtime);