changeset 15123:c8957b9c6202

[gaim-migrate @ 17909] fix 1586525 committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 07 Dec 2006 05:57:53 +0000
parents c6978ee9ac4d
children ed14c190a868
files gtk/gtkroomlist.c libgaim/protocols/gg/gg.c libgaim/protocols/irc/irc.c libgaim/protocols/jabber/chat.c libgaim/protocols/jabber/chat.h libgaim/protocols/jabber/jabber.c libgaim/protocols/msn/msn.c libgaim/protocols/novell/novell.c libgaim/protocols/oscar/libaim.c libgaim/protocols/oscar/libicq.c libgaim/protocols/qq/qq.c libgaim/protocols/simple/simple.c libgaim/protocols/yahoo/yahoo.c libgaim/protocols/zephyr/zephyr.c libgaim/prpl.h
diffstat 15 files changed, 45 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkroomlist.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/gtk/gtkroomlist.c	Thu Dec 07 05:57:53 2006 +0000
@@ -199,7 +199,21 @@
 
 static void do_add_room_cb(GtkWidget *w, struct _menu_cb_info *info)
 {
-	gaim_blist_request_add_chat(info->list->account, NULL, NULL, info->room->name);
+	char *name;
+	GaimConnection *gc = gaim_account_get_connection(info->list->account);
+	GaimPluginProtocolInfo *prpl_info = NULL;
+
+	if(gc != NULL)
+		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
+
+	if(prpl_info != NULL && prpl_info->roomlist_room_serialize)
+		name = prpl_info->roomlist_room_serialize(info->room);
+	else
+		name = g_strdup(info->room->name);
+
+	gaim_blist_request_add_chat(info->list->account, NULL, NULL, name);
+
+	g_free(name);
 }
 
 static void add_room_to_blist_cb(GtkButton *button, GaimGtkRoomlistDialog *dialog)
--- a/libgaim/protocols/gg/gg.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/gg/gg.c	Thu Dec 07 05:57:53 2006 +0000
@@ -2119,6 +2119,7 @@
 	ggp_offline_message,		/* offline_message */
 	NULL,				/* whiteboard_prpl_ops */
 	NULL,				/* send_raw */
+	NULL,				/* roomlist_room_serialize */
 };
 /* }}} */
 
--- a/libgaim/protocols/irc/irc.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/irc/irc.c	Thu Dec 07 05:57:53 2006 +0000
@@ -868,7 +868,8 @@
 	irc_dccsend_new_xfer,	/* new_xfer */
 	NULL,					/* offline_message */
 	NULL,					/* whiteboard_prpl_ops */
-	irc_send_raw,				/* send_raw */
+	irc_send_raw,			/* send_raw */
+	NULL,					/* roomlist_room_serialize */
 };
 
 static gboolean load_plugin (GaimPlugin *plugin) {
--- a/libgaim/protocols/jabber/chat.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/jabber/chat.c	Thu Dec 07 05:57:53 2006 +0000
@@ -84,6 +84,8 @@
 			g_hash_table_insert(defaults, "room", g_strdup(jid->node));
 			if(jid->domain)
 				g_hash_table_replace(defaults, "server", g_strdup(jid->domain));
+			if(jid->resource)
+				g_hash_table_replace(defaults, "handle", g_strdup(jid->resource));
 			jabber_id_free(jid);
 		}
 	}
@@ -749,6 +751,12 @@
 	jabber_iq_send(iq);
 }
 
+char *jabber_roomlist_room_serialize(GaimRoomlistRoom *room)
+{
+
+	return g_strdup_printf("%s@%s", (char*)room->fields->data, (char*)room->fields->next->data);
+}
+
 GaimRoomlist *jabber_roomlist_get_list(GaimConnection *gc)
 {
 	JabberStream *js = gc->proto_data;
--- a/libgaim/protocols/jabber/chat.h	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/jabber/chat.h	Thu Dec 07 05:57:53 2006 +0000
@@ -89,5 +89,7 @@
 
 void jabber_chat_disco_traffic(JabberChat *chat);
 
+char *jabber_roomlist_room_serialize(GaimRoomlistRoom *room);
+
 
 #endif /* _GAIM_JABBER_CHAT_H_ */
--- a/libgaim/protocols/jabber/jabber.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/jabber/jabber.c	Thu Dec 07 05:57:53 2006 +0000
@@ -1902,6 +1902,7 @@
 	jabber_offline_message,			/* offline_message */
 	NULL,							/* whiteboard_prpl_ops */
 	jabber_prpl_send_raw,			/* send_raw */
+	jabber_roomlist_room_serialize, /* roomlist_room_serialize */
 };
 
 static gboolean load_plugin(GaimPlugin *plugin)
--- a/libgaim/protocols/msn/msn.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/msn/msn.c	Thu Dec 07 05:57:53 2006 +0000
@@ -2013,6 +2013,7 @@
 	NULL,					/* offline_message */
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
+	NULL,					/* roomlist_room_serialize */
 };
 
 static GaimPluginInfo info =
--- a/libgaim/protocols/novell/novell.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/novell/novell.c	Thu Dec 07 05:57:53 2006 +0000
@@ -3534,6 +3534,8 @@
 	NULL,						/* offline_message */
 	NULL,						/* whiteboard_prpl_ops */
 	NULL,						/* send_raw */
+	NULL,						/* roomlist_room_serialize */
+
 };
 
 static GaimPluginInfo info = {
--- a/libgaim/protocols/oscar/libaim.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/oscar/libaim.c	Thu Dec 07 05:57:53 2006 +0000
@@ -89,7 +89,8 @@
 	oscar_new_xfer,			/* new_xfer */
 	oscar_offline_message,	/* offline_message */
 	NULL,					/* whiteboard_prpl_ops */
-	NULL,				/* send_raw */
+	NULL,					/* send_raw */
+	NULL,					/* roomlist_room_serialize */
 };
 
 static GaimPluginInfo info =
--- a/libgaim/protocols/oscar/libicq.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/oscar/libicq.c	Thu Dec 07 05:57:53 2006 +0000
@@ -90,7 +90,8 @@
 	oscar_new_xfer,			/* new_xfer */
 	oscar_offline_message,	/* offline_message */
 	NULL,					/* whiteboard_prpl_ops */
-	NULL,				/* send_raw */
+	NULL,					/* send_raw */
+	NULL,					/* roomlist_room_serialize */
 };
 
 static GaimPluginInfo info =
--- a/libgaim/protocols/qq/qq.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/qq/qq.c	Thu Dec 07 05:57:53 2006 +0000
@@ -695,6 +695,7 @@
 	NULL,							/* offline_message */
 	NULL,							/* GaimWhiteboardPrplOps */
 	NULL,							/* send_raw */
+	NULL,							/* roomlist_room_serialize */
 };
 
 static GaimPluginInfo info = {
--- a/libgaim/protocols/simple/simple.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/simple/simple.c	Thu Dec 07 05:57:53 2006 +0000
@@ -1794,7 +1794,8 @@
 	NULL,					/* new_xfer */
 	NULL,					/* offline_message */
 	NULL,					/* whiteboard_prpl_ops */
-	simple_send_raw,			/* send_raw */
+	simple_send_raw,		/* send_raw */
+	NULL,					/* roomlist_room_serialize */
 };
 
 
--- a/libgaim/protocols/yahoo/yahoo.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/yahoo/yahoo.c	Thu Dec 07 05:57:53 2006 +0000
@@ -3878,7 +3878,8 @@
 	yahoo_new_xfer,
 	yahoo_offline_message, /* offline_message */
 	&yahoo_whiteboard_prpl_ops,
-	NULL /* send_raw */
+	NULL, /* send_raw */
+	NULL, /* roomlist_room_serialize */
 };
 
 static GaimPluginInfo info =
--- a/libgaim/protocols/zephyr/zephyr.c	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/protocols/zephyr/zephyr.c	Thu Dec 07 05:57:53 2006 +0000
@@ -2916,6 +2916,7 @@
 	NULL,					/* offline_message */
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
+	NULL,					/* roomlist_room_serialize */
 };
 
 static GaimPluginInfo info = {
--- a/libgaim/prpl.h	Thu Dec 07 04:25:29 2006 +0000
+++ b/libgaim/prpl.h	Thu Dec 07 05:57:53 2006 +0000
@@ -301,6 +301,9 @@
 
 	/* For use in plugins that may understand the underlying protocol */
 	int (*send_raw)(GaimConnection *gc, const char *buf, int len);
+
+	/* room list serialize */
+	char *(*roomlist_room_serialize)(GaimRoomlistRoom *room);
 };
 
 #define GAIM_IS_PROTOCOL_PLUGIN(plugin) \