changeset 27862:382e7565e628

propagate from branch 'im.pidgin.pidgin' (head 3fc4df7332983d84a3632b6372c6f7c894b529a3) to branch 'im.pidgin.pidgin.yaz' (head a1fd4d210ffa81c75a163484d225652ae9727f93)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 11 Jul 2008 18:29:35 +0000
parents 35673f4abf46 (diff) 4af92af950cd (current diff)
children 57727a140609
files configure.ac libpurple/conversation.c libpurple/protocols/oscar/oscar.c
diffstat 13 files changed, 300 insertions(+), 125 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Thu Jul 03 13:49:24 2008 +0000
+++ b/configure.ac	Fri Jul 11 18:29:35 2008 +0000
@@ -336,6 +336,10 @@
 	AC_DEFINE_UNQUOTED(DISPLAY_VERSION, "$VERSION", [display version info])
 fi
 
+AC_ARG_ENABLE(missing-dependencies, [AC_HELP_STRING([--disable-missing-dependencies],
+		[skip missing dependencies instead of aborting configure])],
+	force_deps="$enableval", force_deps="yes")
+
 AC_ARG_WITH(x, [],
 	with_x="$withval", with_x="yes")
 AC_ARG_ENABLE(gtkui, [AC_HELP_STRING([--disable-gtkui],
@@ -419,10 +423,12 @@
 					X11_LIBS="$x_libpath_add"
 					X11_CFLAGS="$x_incpath_add"
 				else
-					AC_MSG_ERROR([
+					if test "x$force_deps" = "xyes" ; then
+						AC_MSG_ERROR([
 X11 development headers not found.
 Use --without-x if you do not need X11 support.
 ])
+					fi
 				fi
 			])
 		AC_SUBST(X11_LIBS)
@@ -461,11 +467,13 @@
 				AC_DEFINE(USE_SCREENSAVER, 1, [Define if we're using XScreenSaver.])
 				AC_SUBST(XSS_LIBS)
 			else
-				AC_MSG_ERROR([
+				if test "x$force_deps" = "xyes" ; then
+					AC_MSG_ERROR([
 XScreenSaver extension development headers not found.
 Use --disable-screensaver if you do not need XScreenSaver extension support,
 this is required for detecting idle time by mouse and keyboard usage.
 ])
+				fi
 			fi
 		else
 			AC_MSG_ERROR([X support is required to build with XScreenSaver extensions])
@@ -490,10 +498,12 @@
 				AC_DEFINE(USE_SM, 1, [Define if we're using X Session Management.])
 				AC_SUBST(SM_LIBS)
 			else
-				AC_MSG_ERROR([
+				if test "x$force_deps" = "xyes" ; then
+					AC_MSG_ERROR([
 X session management development headers not found.
 Use --disable-sm if you do not need session management support.
 ])
+				fi
 			fi
 		else
 			AC_MSG_ERROR([X support is required to build with X session management support])
@@ -515,10 +525,12 @@
 	if test "x$enable_startup_notification" = "xyes"; then
 		PKG_CHECK_MODULES(STARTUP_NOTIFICATION, [libstartup-notification-1.0 >= 0.5], , [
 			AC_MSG_RESULT(no)
-			AC_MSG_ERROR([
+			if test "x$force_deps" = "xyes" ; then
+				AC_MSG_ERROR([
 Startup notification development headers not found.
 Use --disable-startup-notification if you do not need it.
-])])
+])
+			fi])
 
 		if test "x$enable_startup_notification" = "xyes"; then
 			AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
@@ -533,10 +545,12 @@
 	if test "x$enable_gtkspell" = "xyes" ; then
 		PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, , [
 			AC_MSG_RESULT(no)
-			AC_MSG_ERROR([
+			if test "x$force_deps" = "xyes" ; then
+				AC_MSG_ERROR([
 GtkSpell development headers not found.
 Use --disable-gtkspell if you do not need it.
-])])
+])
+			fi])
 		if test "x$enable_gtkspell" = "xyes" ; then
 			AC_DEFINE(USE_GTKSPELL, 1, [Define if we're using GtkSpell])
 			AC_SUBST(GTKSPELL_CFLAGS)
@@ -566,10 +580,12 @@
 			AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
 			AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
 		else
-			AC_MSG_ERROR([
+			if test "x$force_deps" = "xyes" ; then
+				AC_MSG_ERROR([
 Evolution development headers not found.
 Use --disable-gevolution if you do not need it.
 ])
+			fi
 		fi
 	fi
 
@@ -579,10 +595,12 @@
 	if test "x$enable_cap" = "xyes"; then
 		PKG_CHECK_MODULES(SQLITE3, sqlite3 >= 3.3,,[
 			AC_MSG_RESULT(no)
-			AC_MSG_ERROR([
+			if test "x$force_deps" = "xyes" ; then
+				AC_MSG_ERROR([
 sqlite3 development headers not found.
 Use --disable-cap if you do not need the Contact Availability Prediction plugin.
-])])
+])
+			fi])
 	fi
         
 
@@ -719,10 +737,12 @@
 			[], [$GSTREAMER_LIBS])
 	], [
 		AC_MSG_RESULT(no)
-		AC_MSG_ERROR([
+		if test "x$force_deps" = "xyes" ; then
+			AC_MSG_ERROR([
 GStreamer development headers not found.
 Use --disable-gstreamer if you do not need GStreamer (sound) support.
-])])
+])
+		fi])
 fi
 
 dnl #######################################################################
@@ -737,10 +757,12 @@
 		have_meanwhile="yes"
 	], [
 		have_meanwhile="no"
-		AC_MSG_ERROR([
+		if test "x$force_deps" = "xyes" ; then
+			AC_MSG_ERROR([
 Meanwhile development headers not found.
 Use --disable-meanwhile if you do not need meanwhile (Sametime) support.
-])])
+])
+		fi])
 fi
 AC_SUBST(MEANWHILE_CFLAGS)
 AC_SUBST(MEANWHILE_LIBS)
@@ -783,7 +805,7 @@
 fi
 AC_CHECK_LIB(avahi-client, avahi_client_new, [avahilibs=yes], [avahilibs=no], $AVAHI_LIBS)
 
-if test "x$enable_avahi" = "xyes" -a \( "x$avahiincludes" = "xno" -o "x$avahilibs" = "xno" \); then
+if test "x$enable_avahi" = "xyes" -a "x$force_deps" = "xyes" -a \( "x$avahiincludes" = "xno" -o "x$avahilibs" = "xno" \); then
 	AC_MSG_ERROR([
 avahi development headers not found.
 Use --disable-avahi if you do not need avahi (Bonjour) support.
@@ -1155,7 +1177,6 @@
 			"-Wmissing-declarations" \
 			"-Wmissing-noreturn" \
 			"-Wmissing-prototypes" \
-			"-Wnested-externs" \
 			"-Wpointer-arith" \
 			"-Wundef" \
 	; do
@@ -1220,10 +1241,12 @@
 		AC_SUBST(DBUS_LIBS)
 		enable_dbus=yes
 	], [
+	if test "x$force_deps" = "xyes" ; then
 		AC_MSG_ERROR([
 D-Bus development headers not found.
 Use --disable-dbus if you do not need D-Bus support.
-])])
+])
+	fi])
 
 dnl Check for NetworkManager.h; if we don't have it, oh well
 	if test "x$enable_nm" = "xyes" ; then
@@ -1232,10 +1255,12 @@
 			AC_SUBST(NETWORKMANAGER_LIBS)
 			AC_DEFINE(HAVE_NETWORKMANAGER, 1, [Define if we have NetworkManager.])
 		], [
-			AC_MSG_ERROR([
+			if test "x$force_deps" = "xyes" ; then
+				AC_MSG_ERROR([
 NetworkManager development headers not found.
 Use --disable-nm if you do not need NetworkManager support.
-])])
+])
+			fi])
 	fi
 else
 	enable_nm=no
@@ -1548,7 +1573,7 @@
 	AM_CONDITIONAL(USE_PERL, false)
 fi
 
-if test "x$looked_for_perl" = "xyes" -a "x$enable_perl" = "xno"; then
+if test "x$looked_for_perl" = "xyes" -a "x$enable_perl" = "xno" -a "x$force_deps" = "xyes"; then
 	AC_MSG_ERROR([
 Perl development headers not found.
 Use --disable-perl if you do not need Perl scripting support.
@@ -1959,19 +1984,19 @@
 	msg_ssl=$msg_nss
 elif test "x$msg_gnutls" != "x"; then
 	msg_ssl=$msg_gnutls
-elif test "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes"; then
+elif test "x$looked_for_gnutls" = "xyes" -a "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
 	AC_MSG_ERROR([
 Neither GnuTLS or NSS SSL development headers found.
 Use --disable-nss --disable-gnutls if you do not need SSL support.
 MSN, Novell Groupwise and Google Talk will not work without GnuTLS or NSS. OpenSSL is NOT usable!
 ])
-elif test "x$looked_for_gnutls" = "xyes"; then
+elif test "x$looked_for_gnutls" = "xyes" -a "x$force_deps" = "xyes" ; then
 	AC_MSG_ERROR([
 GnuTLS SSL development headers not found.
 Use --disable-gnutls if you do not need SSL support.
 MSN, Novell Groupwise and Google Talk will not work without SSL support.
 ])
-elif test "x$looked_for_nss" = "xyes"; then
+elif test "x$looked_for_nss" = "xyes" -a "x$force_deps" = "xyes" ; then
 	AC_MSG_ERROR([
 NSS SSL development headers not found.
 Use --disable-nss if you do not need SSL support.
@@ -2010,10 +2035,12 @@
 	if test "$TCLCONFIG" = "no"; then
 		AC_MSG_RESULT([no])
 		enable_tcl=no
-		AC_MSG_ERROR([
+		if test "x$force_deps" = "xyes" ; then
+			AC_MSG_ERROR([
 Tcl development headers not found.
 Use --disable-tcl if you do not need Tcl scripting support.
 ])
+		fi
 	else
 		. $TCLCONFIG
 		AC_MSG_CHECKING([Tcl version compatability])
@@ -2078,10 +2105,12 @@
 	if test "$TKCONFIG" = "no"; then
 		AC_MSG_RESULT([no])
 		enable_tk=no
-		AC_MSG_ERROR([
+		if test "x$force_deps" = "xyes" ; then
+			AC_MSG_ERROR([
 Tk development headers not found.
 Use --disable-tk if you do not need Tk scripting support.
 ])
+		fi
 	else
 		. $TKCONFIG
 		eval "TK_LIB_SPEC=\"$TK_LIB_SPEC\""
--- a/libpurple/conversation.c	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/conversation.c	Fri Jul 11 18:29:35 2008 +0000
@@ -1635,7 +1635,7 @@
 		}
 
 		quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(),
-						 "chat-buddy-joining", conv, user, flag)) |
+						 "chat-buddy-joining", conv, user, flag)) ||
 				purple_conv_chat_is_user_ignored(chat, user);
 
 		cbuddy = purple_conv_chat_cb_new(user, alias, flag);
@@ -1647,18 +1647,18 @@
 		cbuddies = g_list_prepend(cbuddies, cbuddy);
 
 		if (!quiet && new_arrivals) {
-			char *escaped = g_markup_escape_text(alias, -1);
+			char *alias_esc = g_markup_escape_text(alias, -1);
 			char *tmp;
 
 			if (extra_msg == NULL)
-				tmp = g_strdup_printf(_("%s entered the room."), escaped);
+				tmp = g_strdup_printf(_("%s entered the room."), alias_esc);
 			else {
-				char *escaped2 = g_markup_escape_text(extra_msg, -1);
+				char *extra_msg_esc = g_markup_escape_text(extra_msg, -1);
 				tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."),
-									  escaped, escaped2);
-				g_free(escaped2);
+				                      alias_esc, extra_msg_esc);
+				g_free(extra_msg_esc);
 			}
-			g_free(escaped);
+			g_free(alias_esc);
 
 			purple_conversation_write(conv, NULL, tmp,
 					PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY,
@@ -1846,7 +1846,7 @@
 
 		if (!quiet) {
 			const char *alias = user;
-			char *escaped;
+			char *alias_esc;
 			char *tmp;
 
 			if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
@@ -1856,17 +1856,17 @@
 					alias = purple_buddy_get_contact_alias(buddy);
 			}
 
-			escaped = g_markup_escape_text(alias, -1);
+			alias_esc = g_markup_escape_text(alias, -1);
 
 			if (reason == NULL || !*reason)
-				tmp = g_strdup_printf(_("%s left the room."), escaped);
+				tmp = g_strdup_printf(_("%s left the room."), alias_esc);
 			else {
-				char *escaped2 = g_markup_escape_text(reason, -1);
+				char *reason_esc = g_markup_escape_text(reason, -1);
 				tmp = g_strdup_printf(_("%s left the room (%s)."),
-									  escaped, escaped2);
-				g_free(escaped2);
+				                      alias_esc, reason_esc);
+				g_free(reason_esc);
 			}
-			g_free(escaped);
+			g_free(alias_esc);
 
 			purple_conversation_write(conv, NULL, tmp,
 					PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY,
--- a/libpurple/conversation.h	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/conversation.h	Fri Jul 11 18:29:35 2008 +0000
@@ -285,11 +285,21 @@
  */
 struct _PurpleConvChatBuddy
 {
-	char *name;                      /**< The name                      */
-	char *alias;					 /**< The alias 					*/
-	char *alias_key;				 /**< The alias key					*/
-	gboolean buddy;					 /**< ChatBuddy is on the blist		*/
-	PurpleConvChatBuddyFlags flags;    /**< Flags (ops, voice etc.)       */
+	char *name;                      /**< The chat participant's name in the chat. */
+	char *alias;                     /**< The chat participant's alias, if known;
+	                                  *   @a NULL otherwise.
+	                                  */
+	char *alias_key;                 /**< A string by which this buddy will be sorted,
+	                                  *   or @c NULL if the buddy should be sorted by
+	                                  *   its @c name.  (This is currently always @c
+	                                  *   NULL.)
+	                                  */
+	gboolean buddy;                  /**< @a TRUE if this chat participant is on the
+	                                  *   buddy list; @a FALSE otherwise.
+	                                  */
+	PurpleConvChatBuddyFlags flags;  /**< A bitwise OR of flags for this participant,
+	                                  *   such as whether they are a channel operator.
+	                                  */
 };
 
 /**
--- a/libpurple/protocols/irc/msgs.c	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/protocols/irc/msgs.c	Fri Jul 11 18:29:35 2008 +0000
@@ -215,10 +215,8 @@
 			/* This is an extended syntax, not in RFC 1459 */
 			int t1 = atoi(args[4]);
 			time_t t2 = time(NULL);
-			msg = g_strdup_printf(ngettext("Ban on %s by %s, set %ld second ago",
-						       "Ban on %s by %s, set %ld seconds ago",
-						       t2 - t1),
-			                      args[2], args[3], t2 - t1);
+			msg = g_strdup_printf(_("Ban on %s by %s, set %s ago"),
+			                      args[2], args[3], purple_str_seconds_to_string(t2 - t1));
 		} else {
 			msg = g_strdup_printf(_("Ban on %s"), args[2]);
 		}
@@ -1007,6 +1005,9 @@
 	irc->reqnick = newnick;
 	irc->nickused = TRUE;
 
+	purple_connection_set_display_name(
+		purple_account_get_connection(irc->account), newnick);
+
 	buf = irc_format(irc, "vn", "NICK", newnick);
 	irc_send(irc, buf);
 	g_free(buf);
--- a/libpurple/protocols/jabber/parser.c	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/protocols/jabber/parser.c	Fri Jul 11 18:29:35 2008 +0000
@@ -132,6 +132,18 @@
 	xmlnode_insert_data(js->current, (const char*) text, text_len);
 }
 
+static void
+jabber_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
+{
+	JabberStream *js = user_data;
+
+	purple_debug_error("jabber", "XML parser error for JabberStream %p: "
+								 "Domain %i, code %i, level %i: %s\n",
+					   js,
+					   error->domain, error->code, error->level,
+					   (error->message ? error->message : "(null)"));
+}
+
 static xmlSAXHandler jabber_parser_libxml = {
 	NULL,									/*internalSubset*/
 	NULL,									/*isStandalone*/
@@ -164,7 +176,7 @@
 	NULL,									/*_private*/
 	jabber_parser_element_start_libxml,		/*startElementNs*/
 	jabber_parser_element_end_libxml,		/*endElementNs*/
-	NULL									/*serror*/
+	jabber_parser_structured_error_handler	/*serror*/
 };
 
 void
@@ -187,15 +199,25 @@
 
 void jabber_parser_process(JabberStream *js, const char *buf, int len)
 {
-	if (js->context ==  NULL) {
+	int ret;
+
+	if (js->context == NULL) {
 		/* libxml inconsistently starts parsing on creating the
 		 * parser, so do a ParseChunk right afterwards to force it. */
 		js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL);
 		xmlParseChunk(js->context, "", 0, 0);
-	} else if (xmlParseChunk(js->context, buf, len, 0) < 0) {
-		purple_connection_error_reason (js->gc,
-			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("XML Parse error"));
+	} else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) {
+		purple_debug_error("jabber", "xmlParseChunk returned error %i", ret);
+
+		if ((ret >= XML_ERR_INVALID_HEX_CHARREF) && (ret <= XML_ERR_INVALID_CHAR)) {
+			/* If the error involves an invalid character, just drop this message.
+			 * We'll create a new parser next time it's needed. */
+			jabber_parser_free(js);
+		} else {
+			purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+				_("XML Parse error"));
+		}
 	}
 }
 
--- a/libpurple/protocols/jabber/presence.c	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/protocols/jabber/presence.c	Fri Jul 11 18:29:35 2008 +0000
@@ -141,6 +141,11 @@
 	/* check for buzz support */
 	allowBuzz = purple_status_get_attr_boolean(status,"buzz");
 	/* changing the buzz state has to trigger a re-broadcasting of the presence for caps */
+
+	if (js->googletalk && stripped == NULL && purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) {
+		tune = purple_presence_get_status(p, "tune");
+		stripped = jabber_google_presence_outgoing(tune);
+	}
 	
 #define CHANGED(a,b) ((!a && b) || (a && a[0] == '\0' && b && b[0] != '\0') || \
 					  (a && !b) || (a && a[0] != '\0' && b && b[0] == '\0') || (a && b && strcmp(a,b)))
@@ -149,11 +154,6 @@
 		js->old_priority != priority || CHANGED(js->old_avatarhash, js->avatar_hash)) {
 		js->allowBuzz = allowBuzz;
 
-		if (js->googletalk && stripped == NULL && purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) {
-			tune = purple_presence_get_status(p, "tune");
-			stripped = jabber_google_presence_outgoing(tune);
-		}
-
 		presence = jabber_presence_create_js(js, state, stripped, priority);
 
 		if(js->avatar_hash) {
@@ -178,9 +178,9 @@
 		js->old_avatarhash = g_strdup(js->avatar_hash);
 		js->old_state = state;
 		js->old_priority = priority;
-		g_free(stripped);
 	}
-					  	
+	g_free(stripped);
+
 	/* next, check if there are any changes to the tune values */
 	tune = purple_presence_get_status(p, "tune");
 	if (tune && purple_status_is_active(tune)) {
--- a/libpurple/protocols/jabber/roster.c	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/protocols/jabber/roster.c	Fri Jul 11 18:29:35 2008 +0000
@@ -316,7 +316,6 @@
 {
 	JabberStream *js = gc->proto_data;
 	char *who;
-	GSList *groups = NULL;
 	JabberBuddy *jb;
 	JabberBuddyResource *jbr;
 	char *my_bare_jid;
@@ -329,20 +328,7 @@
 
 	jb = jabber_buddy_find(js, buddy->name, FALSE);
 
-	/*
-	 * For some reason if we're waiting for our subscription request
-	 * to be approved and we try to add the buddy to another group
-	 * then we remove the buddy from the old group.  I don't understand
-	 * the rationale for this, can someone please explain it?  It seems
-	 * like we should pass NULL as the groups parameter to
-	 * jabber_roster_update().
-	 */
-	if(!jb || !(jb->subscription & JABBER_SUB_TO)) {
-		groups = g_slist_append(groups, group->name);
-	}
-
-	jabber_roster_update(js, who, groups);
-	g_slist_free(groups);
+	jabber_roster_update(js, who, NULL);
 
 	my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain);
 	if(!strcmp(who, my_bare_jid)) {
--- a/libpurple/protocols/oscar/oscar.c	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Fri Jul 11 18:29:35 2008 +0000
@@ -4956,11 +4956,6 @@
 	purple_debug_info("oscar",
 			   "ssi: syncing local list and server list\n");
 
-	if ((timestamp == 0) || (numitems == 0)) {
-		purple_debug_info("oscar", "Got AIM SSI with a 0 timestamp or 0 numitems--not syncing.  This probably means your buddy list is empty.\n");
-		return 1;
-	}
-
 	/* Clean the buddy list */
 	aim_ssi_cleanlist(od);
 
--- a/libpurple/purple-url-handler	Thu Jul 03 13:49:24 2008 +0000
+++ b/libpurple/purple-url-handler	Fri Jul 11 18:29:35 2008 +0000
@@ -6,7 +6,15 @@
 import time
 import urllib
 
-obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+bus = dbus.SessionBus()
+obj = None
+try:
+    obj = bus.get_object("im.pidgin.purple.PurpleService",
+                         "/im/pidgin/purple/PurpleObject")
+except dbus.DBusException, e:
+    if e._dbus_error_name == "org.freedesktop.DBus.Error.ServiceUnknown":
+        print "Error: no libpurple-powered client is running. Try starting Pidgin or Finch."
+        sys.exit(1)
 purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
 
 class CheckedObject:
@@ -50,20 +58,39 @@
     except:
         return value
 
-def findaccount(protocolname, accountname=""):
+def account_not_found():
+    print "No matching account found."
+    sys.exit(1)
+
+def bring_account_online(account):
+    if not cpurple.PurpleAccountIsConnected(account):
+        # The last argument is meant to be a GList * but the D-Bus binding
+        # generator thing just wants a UInt32, which is pretty failing.
+        # Happily, passing a 0 to mean an empty list turns out to work anyway.
+        purple.PurpleAccountSetStatusList(account, "online", 1, 0)
+        purple.PurpleAccountConnect(account)
+
+def findaccount(protocolname, accountname="", matcher=None):
+    if matcher:
+        for account in cpurple.PurpleAccountsGetAll():
+            if accountname != "" and accountname != cpurple.PurpleAccountGetUsername(a):
+                continue
+            if matcher(account):
+                bring_account_online(account)
+                return account
+        account_not_found()
+
     # prefer connected accounts
     account = cpurple.PurpleAccountsFindConnected(accountname, protocolname)
     if (account != 0):
-	return account
+        return account
 
     # try to get any account and connect it
     account = cpurple.PurpleAccountsFindAny(accountname, protocolname)
     if (account == 0):
-        print "No matching account found."
-	sys.exit(1)
+        account_not_found()
 
-    purple.PurpleAccountSetStatusVargs(account, "online", 1)
-    purple.PurpleAccountConnect(account)
+    bring_account_online(account)
     return account
 
 def goim(account, screenname, message=None):
@@ -178,12 +205,16 @@
             key, value = extendlist(param.split("=", 1), 2, "")
             params[key] = urllib.unquote_plus(value)
 
-    account = findaccount(protocol)
+    def correct_server(account):
+        username = cpurple.PurpleAccountGetUsername(account)
+        return (server == (username.split("@"))[1])
+
+    account = findaccount(protocol, matcher=correct_server)
 
     if (target != ""):
         if (isnick):
             goim(account, urllib.unquote_plus(target.split(",")[0]), params.get("msg"))
-	else:
+        else:
             channel = urllib.unquote_plus(target.split(",")[0])
             if channel[0] != "#":
                 channel = "#" + channel
@@ -213,9 +244,9 @@
         addbuddy(account, screenname)
 
 def myim(uri):
-	protocol = "prpl-myspace"
-	print "TODO: send uri: ", uri
-	assert False, "Not implemented"
+        protocol = "prpl-myspace"
+        print "TODO: send uri: ", uri
+        assert False, "Not implemented"
 
 def sip(uri):
     protocol = "prpl-simple"
@@ -328,9 +359,9 @@
             ymsgr(uri)
         else:
             print "Unknown protocol: %s" % type
-    except dbus.dbus_bindings.DBusException:
-        print "ERROR: Is there a libpurple-powered client (e.g. Pidgin or Finch) running?"
-
+    except dbus.DBusException, e:
+        print "Error: %s" % (e.message)
+        sys.exit(1)
 
 if __name__ == "__main__":
     main()
--- a/po/de.po	Thu Jul 03 13:49:24 2008 +0000
+++ b/po/de.po	Fri Jul 11 18:29:35 2008 +0000
@@ -11,9 +11,9 @@
 msgstr ""
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-06-25 23:30+0200\n"
-"PO-Revision-Date: 2008-06-25 23:27+0200\n"
-"Last-Translator: Bjoern Voigt <bjoern@cs.tu-berlin.de>\n"
+"POT-Creation-Date: 2008-07-11 17:26+0200\n"
+"PO-Revision-Date: 2008-07-11 17:25+0200\n"
+"Last-Translator: Jochen Kemnade <jochenkemnade@web.de>\n"
 "Language-Team: Deutsch <de@li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -3232,10 +3232,8 @@
 msgstr "Falscher Modus"
 
 #, c-format
-msgid "Ban on %s by %s, set %ld second ago"
-msgid_plural "Ban on %s by %s, set %ld seconds ago"
-msgstr[0] "Verbot zu %s von %s, gesetzt vor %ld Sekunde"
-msgstr[1] "Verbot zu %s von %s, gesetzt vor %ld Sekunden"
+msgid "Ban on %s by %s, set %s ago"
+msgstr "Verbot zu %s von %s, gesetzt vor %s"
 
 #, c-format
 msgid "Ban on %s"
@@ -6369,7 +6367,6 @@
 "versuchen Sie es noch einmal. Wenn Sie es weiterversuchen, müssen Sie sogar "
 "noch länger warten."
 
-#. client too old
 #, c-format
 msgid "The client version you are using is too old. Please upgrade at %s"
 msgstr ""
@@ -7336,10 +7333,6 @@
 msgid "Unable to login"
 msgstr "Anmeldung fehlgeschlagen"
 
-#. we didn't successfully connect. tdt->toc_fd is valid here
-msgid "Unable to connect."
-msgstr "Verbindung nicht möglich."
-
 #, c-format
 msgid "Unknown-%d"
 msgstr "Unbekannt-%d"
@@ -7365,12 +7358,16 @@
 msgstr "<b>Letzte Aktualisierung</b>: %s<br>\n"
 
 #, c-format
+msgid "<b>Server</b>: %s: %d<br>\n"
+msgstr "<b>Server</b>: %s: %d<br>\n"
+
+#, c-format
 msgid "<b>Connection Mode</b>: %s<br>\n"
 msgstr "<b>Verbindungsmodus</b>: %s<br>\n"
 
 #, c-format
-msgid "<b>Server IP</b>: %s: %d<br>\n"
-msgstr "<b>Server-IP</b>: %s: %d<br>\n"
+msgid "<b>Real hostname</b>: %s: %d<br>\n"
+msgstr "<b>Wirklicher Hostname</b>: %s: %d<br>\n"
 
 #, c-format
 msgid "<b>My Public IP</b>: %s<br>\n"
@@ -7422,12 +7419,49 @@
 msgid "Connect using TCP"
 msgstr "Über TCP verbinden"
 
+msgid "Failed to connect server"
+msgstr "Verbinden zum Server fehlgeschlagen"
+
 msgid "Socket error"
 msgstr "Socket-Fehler"
 
+#, c-format
+msgid ""
+"Lost connection with server:\n"
+"%d, %s"
+msgstr ""
+"Verbindung zum Server verloren:\n"
+"%d, %s"
+
 msgid "Unable to read from socket"
 msgstr "Socket kann nicht gelesen werden"
 
+msgid "Write Error"
+msgstr "Schreibfehler"
+
+msgid "Connection lost"
+msgstr "Verbindung verloren"
+
+msgid "Login failed, no reply"
+msgstr "Anmeldung fehlgeschlagen, keine Antwort"
+
+msgid "Couldn't resolve host"
+msgstr "Kann den Hostnamen nicht auflösen"
+
+msgid "hostname is NULL or port is 0"
+msgstr "Hostname ist NULL oder Port ist 0"
+
+#, c-format
+msgid "Connecting server %s, retries %d"
+msgstr "Verbinde zu Server %s, %d Wiederholungen"
+
+#. we didn't successfully connect. tdt->toc_fd is valid here
+msgid "Unable to connect."
+msgstr "Verbindung nicht möglich."
+
+msgid "Could not resolve hostname"
+msgstr "Konnte den Hostnamen nicht auflösen"
+
 #, c-format
 msgid "%d has declined the file %s"
 msgstr "%d hat die Datei %s abgelehnt"
@@ -7439,12 +7473,6 @@
 msgid "%d canceled the transfer of %s"
 msgstr "%d hat die Übertragung von %s abgebrochen"
 
-msgid "Connection lost"
-msgstr "Verbindung verloren"
-
-msgid "Login failed, no reply"
-msgstr "Anmeldung fehlgeschlagen, keine Antwort"
-
 msgid "Do you want to add this buddy?"
 msgstr "Möchten Sie diesen Buddy hinzufügen?"
 
@@ -8502,6 +8530,10 @@
 msgid "Error loading SILC key pair"
 msgstr "Fehler beim Laden des SILC-Schlüsselpaares"
 
+#, c-format
+msgid "Download %s: %s"
+msgstr "Download %s: %s"
+
 msgid "Your Current Mood"
 msgstr "Ihre momentane Stimmung"
 
@@ -8946,12 +8978,6 @@
 msgid "Could not create listen socket"
 msgstr "Kann Listen-Socket nicht erstellen"
 
-msgid "Couldn't resolve host"
-msgstr "Kann den Hostnamen nicht auflösen"
-
-msgid "Could not resolve hostname"
-msgstr "Konnte den Hostnamen nicht auflösen"
-
 msgid "SIP usernames may not contain whitespaces or @ symbols"
 msgstr "SIP-Benutzernamen dürfen keine Leerzeichen oder @-Symbole enthalten"
 
@@ -9398,9 +9424,6 @@
 msgid "%s is trying to send you a group of %d files.\n"
 msgstr "%s versucht, Ihnen eine Gruppe von %d Dateien zu senden.\n"
 
-msgid "Write Error"
-msgstr "Schreibfehler"
-
 msgid "Yahoo! Japan Profile"
 msgstr "Yahoo!-Japan-Profil"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/ca-certs/CAcert_Class3.pem	Fri Jul 11 18:29:35 2008 +0000
@@ -0,0 +1,35 @@
+-----BEGIN CERTIFICATE-----
+MIIGCDCCA/CgAwIBAgIBATANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
+Y2FjZXJ0Lm9yZzAeFw0wNTEwMTQwNzM2NTVaFw0zMzAzMjgwNzM2NTVaMFQxFDAS
+BgNVBAoTC0NBY2VydCBJbmMuMR4wHAYDVQQLExVodHRwOi8vd3d3LkNBY2VydC5v
+cmcxHDAaBgNVBAMTE0NBY2VydCBDbGFzcyAzIFJvb3QwggIiMA0GCSqGSIb3DQEB
+AQUAA4ICDwAwggIKAoICAQCrSTURSHzSJn5TlM9Dqd0o10Iqi/OHeBlYfA+e2ol9
+4fvrcpANdK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qbn3BHLt4Ui9SyIAmW
+omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
+-----END CERTIFICATE-----
--- a/share/ca-certs/Makefile.am	Thu Jul 03 13:49:24 2008 +0000
+++ b/share/ca-certs/Makefile.am	Fri Jul 11 18:29:35 2008 +0000
@@ -1,4 +1,6 @@
 CERTIFICATES = \
+		CAcert_Root.pem \
+		CAcert_Class3.pem \
 		Equifax_Secure_CA.pem \
 		GTE_CyberTrust_Global_Root.pem \
 		Microsoft_Secure_Server_Authority.pem \