changeset 27820:e0a04ba10ae1

propagate from branch 'im.pidgin.pidgin' (head adef47c71d9ea87e0876e37870d390b39ea7ea04) to branch 'im.pidgin.pidgin.yaz' (head 9aba36914308eb2b210511c4b5f6bbbc07ef6d17)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 15 Apr 2008 05:18:55 +0000
parents 030185a59a1a (current diff) 3378d2701c2b (diff)
children 3a305a4511ea
files libpurple/protocols/yahoo/yahoo.c
diffstat 3 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntlog.c	Sun Apr 13 22:46:58 2008 +0000
+++ b/finch/gntlog.c	Tue Apr 15 05:18:55 2008 +0000
@@ -23,7 +23,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
-#include "internal.h"
+#include "finch.h"
 
 #include <gnt.h>
 #include <gntbox.h>
--- a/libpurple/protocols/yahoo/yahoo.c	Sun Apr 13 22:46:58 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Tue Apr 15 05:18:55 2008 +0000
@@ -346,7 +346,7 @@
 			break;
 
 		default:
-			purple_debug(PURPLE_DEBUG_ERROR, "yahoo",
+			purple_debug_warning("yahoo",
 					   "Unknown status key %d\n", pair->key);
 			break;
 		}
--- a/pidgin/plugins/markerline.c	Sun Apr 13 22:46:58 2008 +0000
+++ b/pidgin/plugins/markerline.c	Tue Apr 15 05:18:55 2008 +0000
@@ -216,6 +216,32 @@
 	attach_to_pidgin_window(win, NULL);
 }
 
+static void
+jump_to_markerline(PurpleConversation *conv, gpointer null)
+{
+	PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+	int offset;
+	GtkTextIter iter;
+
+	if (!gtkconv)
+		return;
+
+	offset = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->imhtml), "markerline"));
+	gtk_text_buffer_get_iter_at_offset(GTK_IMHTML(gtkconv->imhtml)->text_buffer, &iter, offset);
+	gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(gtkconv->imhtml), &iter, 0, TRUE, 0, 0);
+}
+
+static void
+conv_menu_cb(PurpleConversation *conv, GList **list)
+{
+	PurpleConversationType type = purple_conversation_get_type(conv);
+	gboolean enabled = ((type == PURPLE_CONV_TYPE_IM && purple_prefs_get_bool(PREF_IMS)) ||
+		(type == PURPLE_CONV_TYPE_CHAT && purple_prefs_get_bool(PREF_CHATS)));
+	PurpleMenuAction *action = purple_menu_action_new(_("Jump to markerline"),
+			enabled ? PURPLE_CALLBACK(jump_to_markerline) : NULL, NULL, NULL);
+	*list = g_list_append(*list, action);
+}
+
 static gboolean
 plugin_load(PurplePlugin *plugin)
 {
@@ -224,6 +250,8 @@
 	purple_signal_connect(purple_conversations_get_handle(), "conversation-created",
 						plugin, PURPLE_CALLBACK(conv_created), NULL);
 
+	purple_signal_connect(purple_conversations_get_handle(), "conversation-extended-menu",
+						plugin, PURPLE_CALLBACK(conv_menu_cb), NULL);
 	return TRUE;
 }