changeset 29890:08ceb05e9fe9

merged with im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 28 Feb 2010 06:13:14 +0900
parents 0fe3f0bc0695 (current diff) 0d3151a41134 (diff)
children f5d753b3d01d
files libpurple/protocols/jabber/jabber.c pidgin/gtkblist.c
diffstat 9 files changed, 69 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/example/nullclient.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/libpurple/example/nullclient.c	Sun Feb 28 06:13:14 2010 +0900
@@ -27,7 +27,11 @@
 
 #include <signal.h>
 #include <string.h>
+#ifndef _WIN32
 #include <unistd.h>
+#else
+#include "win32/win32dep.h"
+#endif
 
 #include "defines.h"
 
@@ -80,7 +84,11 @@
 	if (condition & PURPLE_INPUT_WRITE)
 		cond |= PURPLE_GLIB_WRITE_COND;
 
+#if defined _WIN32 && !defined WINPIDGIN_USE_GLIB_IO_CHANNEL
+	channel = wpurple_g_io_channel_win32_new_socket(fd);
+#else
 	channel = g_io_channel_unix_new(fd);
+#endif
 	closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,
 					      purple_glib_io_invoke, closure, purple_glib_io_destroy);
 
@@ -253,12 +261,14 @@
 	PurpleSavedStatus *status;
 	char *res;
 
+#ifndef _WIN32
 	/* libpurple's built-in DNS resolution forks processes to perform
 	 * blocking lookups without blocking the main process.  It does not
 	 * handle SIGCHLD itself, so if the UI does not you quickly get an army
 	 * of zombie subprocesses marching around.
 	 */
 	signal(SIGCHLD, SIG_IGN);
+#endif
 
 	init_libpurple();
 
--- a/libpurple/protocols/jabber/jabber.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/libpurple/protocols/jabber/jabber.c	Sun Feb 28 06:13:14 2010 +0900
@@ -70,6 +70,8 @@
 #include "jingle/jingle.h"
 #include "jingle/rtp.h"
 
+#define PING_TIMEOUT 60
+
 GList *jabber_features = NULL;
 GList *jabber_identities = NULL;
 static GSList *jabber_cmds = NULL;
@@ -523,9 +525,12 @@
 
 void jabber_keepalive(PurpleConnection *gc)
 {
-	JabberStream *js = gc->proto_data;
-
-	if (js->keepalive_timeout == 0) {
+	JabberStream *js = purple_connection_get_protocol_data(gc);
+	time_t now = time(NULL);
+
+	if (js->keepalive_timeout == 0 && (now - js->last_ping) >= PING_TIMEOUT) {
+		js->last_ping = now;
+
 		jabber_keepalive_ping(js);
 		js->keepalive_timeout = purple_timeout_add_seconds(120,
 				(GSourceFunc)(jabber_keepalive_timeout), gc);
--- a/libpurple/protocols/jabber/jabber.h	Thu Feb 25 16:27:25 2010 +0900
+++ b/libpurple/protocols/jabber/jabber.h	Sun Feb 28 06:13:14 2010 +0900
@@ -166,6 +166,11 @@
 	time_t idle;
 	time_t old_idle;
 
+	/** When we last pinged the server, so we don't ping more
+	 *  often than once every minute.
+	 */
+	time_t last_ping;
+
 	JabberID *user;
 	JabberBuddy *user_jb;
 
--- a/libpurple/protocols/jabber/usermood.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/libpurple/protocols/jabber/usermood.c	Sun Feb 28 06:13:14 2010 +0900
@@ -75,8 +75,8 @@
 	{"hungry", N_("Hungry"), NULL},
 	{"hurt", N_("Hurt"), NULL},
 	{"impressed", N_("Impressed"), NULL},
-	{"in_awe", N_("In_awe"), NULL},
-	{"in_love", N_("In_love"), NULL},
+	{"in_awe", N_("In awe"), NULL},
+	{"in_love", N_("In love"), NULL},
 	{"indignant", N_("Indignant"), NULL},
 	{"interested", N_("Interested"), NULL},
 	{"intoxicated", N_("Intoxicated"), NULL},
@@ -239,13 +239,14 @@
 void jabber_mood_set(JabberStream *js, const char *mood, const char *text) {
 	xmlnode *publish, *moodnode;
 
-	g_return_if_fail(mood != NULL);
-
 	publish = xmlnode_new("publish");
 	xmlnode_set_attrib(publish,"node","http://jabber.org/protocol/mood");
 	moodnode = xmlnode_new_child(xmlnode_new_child(publish, "item"), "mood");
 	xmlnode_set_namespace(moodnode, "http://jabber.org/protocol/mood");
-	xmlnode_new_child(moodnode, mood);
+	if (mood) {
+		/* if mood is NULL, set an empty mood node, meaning: unset mood */
+	    xmlnode_new_child(moodnode, mood);
+	}
 
 	if (text && text[0] != '\0') {
 		xmlnode *textnode = xmlnode_new_child(moodnode, "text");
--- a/libpurple/win32/global.mak	Thu Feb 25 16:27:25 2010 +0900
+++ b/libpurple/win32/global.mak	Sun Feb 28 06:13:14 2010 +0900
@@ -15,7 +15,7 @@
 GTK_TOP ?= $(WIN32_DEV_TOP)/gtk_2_0-2.14
 GTK_BIN ?= $(GTK_TOP)/bin
 BONJOUR_TOP ?= $(WIN32_DEV_TOP)/Bonjour_SDK
-LIBXML2_TOP ?= $(WIN32_DEV_TOP)/libxml2-2.7.3
+LIBXML2_TOP ?= $(WIN32_DEV_TOP)/libxml2-2.7.4
 MEANWHILE_TOP ?= $(WIN32_DEV_TOP)/meanwhile-1.0.2_daa2
 NSPR_TOP ?= $(WIN32_DEV_TOP)/nspr-4.6.4
 NSS_TOP ?= $(WIN32_DEV_TOP)/nss-3.11.4
--- a/pidgin/gtkblist.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/pidgin/gtkblist.c	Sun Feb 28 06:13:14 2010 +0900
@@ -7834,7 +7834,7 @@
 		const char *mood = purple_request_field_list_get_data(f, l->data);
 		PurpleAccount *account = purple_connection_get_account(gc);
 
-		if (mood != NULL) {
+		if (mood != NULL && !purple_strequal(mood, "")) {
 			purple_account_set_status(account, "mood", TRUE,
 			                          PURPLE_MOOD_NAME, mood,
 			                          NULL);
@@ -7857,7 +7857,7 @@
 	PurpleConnection *gc = purple_account_get_connection(account);
 	PurplePluginProtocolInfo *prpl_info;
 	PurpleMood *mood;
-
+	
 	g_return_if_fail(gc->prpl != NULL);
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
 
@@ -7875,6 +7875,11 @@
 
 	g_free(na_fn);
 
+	/* first item is an empty one for unsetting the mood */
+	purple_request_field_list_add(f, "", "");
+	if (purple_strequal(current_mood, ""))
+		purple_request_field_list_add_selected(f, "");
+	
 	/* TODO: rlaager wants this sorted. */
 	for (mood = prpl_info->get_moods(account);
 	     mood->mood != NULL ; mood++) {
--- a/pidgin/plugins/gtkbuddynote.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/pidgin/plugins/gtkbuddynote.c	Sun Feb 28 06:13:14 2010 +0900
@@ -31,11 +31,13 @@
 		const gchar *note = purple_blist_node_get_string(node, "notes");
 
 		if ((note != NULL) && (*note != '\0')) {
-			char *tmp;
+			char *tmp, *esc;
 			purple_markup_html_to_xhtml(note, NULL, &tmp);
+			esc = g_markup_escape_text(tmp, -1);
+			g_free(tmp);
 			g_string_append_printf(text, _("\n<b>Buddy Note</b>: %s"),
-			                       tmp);
-			g_free(tmp);
+			                       esc);
+			g_free(esc);
 		}
 	}
 }
--- a/pidgin/win32/gtkwin32dep.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/pidgin/win32/gtkwin32dep.c	Sun Feb 28 06:13:14 2010 +0900
@@ -375,11 +375,27 @@
 }
 
 void winpidgin_init(HINSTANCE hint) {
+	FARPROC proc;
 
 	purple_debug_info("winpidgin", "winpidgin_init start\n");
 
 	exe_hInstance = hint;
 
+	proc = wpurple_find_and_loadproc("exchndl.dll", "SetLogFile");
+	if (proc) {
+		gchar *debug_dir, *locale_debug_dir;
+		
+		debug_dir = g_build_filename(purple_user_dir(), "pidgin.RPT", NULL);
+		locale_debug_dir = g_locale_from_utf8(debug_dir, -1, NULL, NULL, NULL);
+
+		purple_debug_info("winpidgin", "Setting exchndl.dll LogFile to %s\n", debug_dir);
+
+		(proc)(locale_debug_dir);
+
+		g_free(debug_dir);
+		g_free(locale_debug_dir);
+	}
+
 	/* IdleTracker Initialization */
 	if(!winpidgin_set_idlehooks())
 		purple_debug_error("winpidgin", "Failed to initialize idle tracker\n");
--- a/pidgin/win32/nsis/pidgin-installer.nsi	Thu Feb 25 16:27:25 2010 +0900
+++ b/pidgin/win32/nsis/pidgin-installer.nsi	Sun Feb 28 06:13:14 2010 +0900
@@ -352,12 +352,11 @@
   Pop $R0
   StrCmp $R0 "cancel" done
   StrCmp $R0 "success" +2
-    MessageBox MB_RETRYCANCEL "$(PIDGIN_GTK_DOWNLOAD_ERROR) : $R1" /SD IDCANCEL IDRETRY retry IDCANCEL done
+    MessageBox MB_RETRYCANCEL "$(PIDGIN_GTK_DOWNLOAD_ERROR) : $R2" /SD IDCANCEL IDRETRY retry IDCANCEL done
 
 !endif
 
   SetOutPath "$INSTDIR"
-
   nsisunz::UnzipToLog $R1 "$INSTDIR"
   Pop $R0
   StrCmp $R0 "success" +2
@@ -610,17 +609,17 @@
 SectionGroupEnd
 
 Section /o $(DEBUG_SYMBOLS_SECTION_TITLE) SecDebugSymbols
+  
   InitPluginsDir
-
-  ; We need to download and extract the debug symbols
-  StrCpy $R1 "$PLUGINSDIR\pidgin-${PIDGIN_VERSION}-dbgsym.zip"
+  StrCpy $R1 "$PLUGINSDIR\dbgsym.zip"
 !ifdef OFFLINE_INSTALLER
 
   SetOutPath $PLUGINSDIR
-  File /oname=pidgin-${PIDGIN_VERSION}-dbgsym.zip "..\..\..\..\gtk_installer\gtk-runtime-${GTK_INSTALL_VERSION}.zip"
+  File /oname=dbgsym.zip "..\..\..\pidgin-${PIDGIN_VERSION}-dbgsym.zip"
 
 !else
 
+  ; We need to download the debug symbols
   retry:
   StrCpy $R2 "${DOWNLOADER_URL}?version=${PIDGIN_VERSION}&dl_pkg=dbgsym"
   DetailPrint "Downloading Debug Symbols... ($R2)"
@@ -632,6 +631,7 @@
 
 !endif
 
+  SetOutPath "$INSTDIR"
   nsisunz::UnzipToLog $R1 "$INSTDIR"
   Pop $R0
   StrCmp $R0 "success" +2
@@ -801,7 +801,7 @@
     ; Remove the local GTK+ copy (if we're not just upgrading)
     ${GetParameters} $R0
     ClearErrors
-    ${GetOptions} "$R3" "/KEEPGTK=" $R1
+    ${GetOptions} "$R0" "/KEEPGTK=" $R1
     IfErrors +2
     StrCmp $R1 "1" +2
     RMDir /r "$INSTDIR\Gtk"
@@ -1368,6 +1368,10 @@
   Push $R0
   Push $R1
 
+!ifdef OFFLINE_INSTALLER
+    !insertmacro SelectSection ${SecDebugSymbols}
+!endif
+
   Call DoWeNeedGtk
   Pop $R0
   IntCmp $R0 1 done gtk_not_mandatory