Mercurial > pidgin.yaz
changeset 25519:abe50b986b15
propagate from branch 'im.pidgin.pidgin' (head 0c6d125066d754b13d41953911c8ea86f0289ec4)
to branch 'im.pidgin.pidgin.yaz' (head 2035c63010625d1a55bf2395a7c338c45f33b548)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 26 Jun 2007 05:08:44 +0000 |
parents | 95731e366df2 (diff) db41905e7cc4 (current diff) |
children | 3b0d12179262 |
files | libpurple/protocols/oscar/oscar.c |
diffstat | 19 files changed, 131 insertions(+), 89 deletions(-) [+] |
line wrap: on
line diff
--- a/COPYRIGHT Sun Jun 24 16:09:25 2007 +0000 +++ b/COPYRIGHT Tue Jun 26 05:08:44 2007 +0000 @@ -356,6 +356,7 @@ Cestonaro Thilo Will Thompson Douglas Thrift (douglaswth) +Mark Tiefenbruck Andrew Tinney Jeffery To Warren Togami
--- a/finch/gntplugin.c Sun Jun 24 16:09:25 2007 +0000 +++ b/finch/gntplugin.c Tue Jun 26 05:08:44 2007 +0000 @@ -277,6 +277,14 @@ { PurplePlugin *plug = iter->data; + if (plug->info->type == PURPLE_PLUGIN_LOADER) { + GList *cur; + for (cur = PURPLE_PLUGIN_LOADER_INFO(plug)->exts; cur != NULL; + cur = cur->next) + purple_plugins_probe(cur->data); + continue; + } + if (plug->info->type != PURPLE_PLUGIN_STANDARD || (plug->info->flags & PURPLE_PLUGIN_FLAG_INVISIBLE) || plug->error)
--- a/libpurple/Makefile.am Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/Makefile.am Tue Jun 26 05:08:44 2007 +0000 @@ -157,10 +157,10 @@ purple_build_coreheaders = $(addprefix $(srcdir)/, $(purple_coreheaders)) dbus_build_exported = $(addprefix $(srcdir)/, $(dbus_exported)) -dbus-types.c: dbus-analyze-types.py $(purple_coreheaders) +dbus-types.c: dbus-analyze-types.py $(purple_build_coreheaders) cat $(purple_build_coreheaders) | $(PYTHON) $(srcdir)/dbus-analyze-types.py --pattern=PURPLE_DBUS_DEFINE_TYPE\(%s\) > $@ -dbus-types.h: dbus-analyze-types.py $(dbus_coreheaders) +dbus-types.h: dbus-analyze-types.py $(purple_build_coreheaders) cat $(purple_build_coreheaders) | $(PYTHON) $(srcdir)/dbus-analyze-types.py --pattern=PURPLE_DBUS_DECLARE_TYPE\(%s\) > $@ dbus-bindings.c: dbus-analyze-functions.py $(dbus_exported)
--- a/libpurple/plugins/perl/scripts/signals-test.pl Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/plugins/perl/scripts/signals-test.pl Tue Jun 26 05:08:44 2007 +0000 @@ -7,7 +7,7 @@ name => "Perl: $MODULE_NAME", version => "0.1", summary => "Signals Test plugin for the Perl interpreter.", - description => "Demonstrate the user of purple signals from " . + description => "Demonstrate the use of purple signals from " . "a perl plugin.", author => "Sadrul Habib Chowdhury <sadrul\@pidgin.im>", url => "http://developer.pidgin.im/wiki/sadrul/",
--- a/libpurple/protocols/bonjour/buddy.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/bonjour/buddy.c Tue Jun 26 05:08:44 2007 +0000 @@ -17,6 +17,7 @@ #include <glib.h> #include <stdlib.h> +#include "internal.h" #include "buddy.h" #include "account.h" #include "blist.h"
--- a/libpurple/protocols/bonjour/jabber.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Tue Jun 26 05:08:44 2007 +0000 @@ -31,6 +31,7 @@ #include <unistd.h> #include <fcntl.h> +#include "internal.h" #include "network.h" #include "eventloop.h" #include "connection.h"
--- a/libpurple/protocols/bonjour/mdns_common.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/bonjour/mdns_common.c Tue Jun 26 05:08:44 2007 +0000 @@ -16,6 +16,7 @@ #include <string.h> +#include "internal.h" #include "config.h" #include "mdns_common.h" #include "bonjour.h"
--- a/libpurple/protocols/bonjour/mdns_win32.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/bonjour/mdns_win32.c Tue Jun 26 05:08:44 2007 +0000 @@ -14,6 +14,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "internal.h" #include "mdns_win32.h" #include "debug.h"
--- a/libpurple/protocols/jabber/presence.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/jabber/presence.c Tue Jun 26 05:08:44 2007 +0000 @@ -565,9 +565,7 @@ } if((found_jbr = jabber_buddy_find_resource(jb, NULL))) { - if(!jbr || jbr == found_jbr) { - purple_prpl_got_user_status(js->gc->account, buddy_name, jabber_buddy_state_get_status_id(state), "priority", found_jbr->priority, found_jbr->status ? "message" : NULL, found_jbr->status, NULL); - } + purple_prpl_got_user_status(js->gc->account, buddy_name, jabber_buddy_state_get_status_id(state), "priority", found_jbr->priority, found_jbr->status ? "message" : NULL, found_jbr->status, NULL); } else { purple_prpl_got_user_status(js->gc->account, buddy_name, "offline", status ? "message" : NULL, status, NULL); }
--- a/libpurple/protocols/oscar/family_auth.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/oscar/family_auth.c Tue Jun 26 05:08:44 2007 +0000 @@ -211,7 +211,7 @@ #ifdef USE_XOR_FOR_ICQ /* If we're signing on an ICQ account then use the older, XOR login method */ - if (isdigit(sn[0])) + if (aim_sn_is_icq(sn)) return goddamnicq2(od, conn, sn, password, ci); #endif @@ -224,7 +224,7 @@ /* Truncate ICQ and AOL passwords, if necessary */ password_len = strlen(password); - if (isdigit(sn[0]) && (password_len > MAXICQPASSLEN)) + if (aim_sn_is_icq(sn) && (password_len > MAXICQPASSLEN)) password_len = MAXICQPASSLEN; else if (truncate_pass && password_len > 8) password_len = 8; @@ -477,7 +477,7 @@ return -EINVAL; #ifdef USE_XOR_FOR_ICQ - if (isdigit(sn[0])) + if (aim_sn_is_icq(sn)) return goddamnicq(od, conn, sn); #endif
--- a/libpurple/protocols/oscar/oscar.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Tue Jun 26 05:08:44 2007 +0000 @@ -444,7 +444,7 @@ charsetstr1 = "UCS-2BE"; charsetstr2 = "UTF-8"; } else if (charset == AIM_CHARSET_CUSTOM) { - if ((sourcesn != NULL) && isdigit(sourcesn[0])) + if ((sourcesn != NULL) && aim_sn_is_icq(sourcesn)) charsetstr1 = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); else charsetstr1 = "ISO-8859-1"; @@ -1279,7 +1279,7 @@ if (!aim_snvalid(purple_account_get_username(account))) { gchar *buf; - buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the screen name is invalid. Screen names must either start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account)); + buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the screen name is invalid. Screen names must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account)); gc->wants_to_die = TRUE; purple_connection_error(gc, buf); g_free(buf); @@ -4650,7 +4650,7 @@ if (!aim_snvalid(buddy->name)) { gchar *buf; - buf = g_strdup_printf(_("Could not add the buddy %s because the screen name is invalid. Screen names must either start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name); + buf = g_strdup_printf(_("Could not add the buddy %s because the screen name is invalid. Screen names must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name); if (!purple_conv_present_error(buddy->name, purple_connection_get_account(gc), buf)) purple_notify_error(gc, NULL, _("Unable To Add"), buf); g_free(buf); @@ -5087,7 +5087,8 @@ default: { /* La la la */ gchar *buf; purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); - buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason. The most common reason for this is that you have the maximum number of allowed buddies in your buddy list."), (retval->name ? retval->name : _("(no name)"))); + buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), + (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) purple_notify_error(gc, NULL, _("Unable To Add"), buf); g_free(buf);
--- a/libpurple/protocols/oscar/util.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/oscar/util.c Tue Jun 26 05:08:44 2007 +0000 @@ -37,6 +37,7 @@ * -- DMP. * */ +/* TODO: Get rid of this and use glib functions */ int aimutil_tokslen(char *toSearch, int theindex, char dl) { @@ -138,6 +139,7 @@ * Check if the given screen name is a valid AIM screen name. * Example: BobDole * Example: Henry_Ford@mac.com + * Example: 1KrazyKat@example.com * * @return TRUE if the screen name is valid, FALSE if not. */ @@ -146,9 +148,16 @@ { int i; + if (purple_email_is_valid(sn)) + return TRUE; + + /* Normal AIM screen names can't start with a number */ + if (isdigit(sn[0])) + return FALSE; + for (i = 0; sn[i] != '\0'; i++) { if (!isalnum(sn[i]) && (sn[i] != ' ') && - (sn[i] != '@') && (sn[i] != '.') && + (sn[i] != '.') && (sn[i] != '_') && (sn[i] != '-')) return FALSE; } @@ -169,10 +178,10 @@ for (i = 0; sn[i] != '\0'; i++) { if (!isdigit(sn[i])) - return 0; + return FALSE; } - return 1; + return TRUE; } /** @@ -187,14 +196,14 @@ int i; if (sn[0] != '+') - return 0; + return FALSE; for (i = 1; sn[i] != '\0'; i++) { if (!isdigit(sn[i])) - return 0; + return FALSE; } - return 1; + return TRUE; } /** @@ -206,70 +215,37 @@ aim_snvalid(const char *sn) { if ((sn == NULL) || (*sn == '\0')) - return 0; + return FALSE; - if (isalpha(sn[0])) - return aim_snvalid_aim(sn); - else if (isdigit(sn[0])) - return aim_snvalid_icq(sn); - else if (sn[0] == '+') - return aim_snvalid_sms(sn); - - return 0; + return aim_snvalid_icq(sn) || aim_snvalid_sms(sn) || aim_snvalid_aim(sn); } /** * Determine if a given screen name is an ICQ screen name - * (i.e. it begins with a number). + * (i.e. it is composed of only numbers). * - * @sn A valid AIM or ICQ screen name. + * @param sn A valid AIM or ICQ screen name. * @return TRUE if the screen name is an ICQ screen name. Otherwise * FALSE is returned. */ gboolean aim_sn_is_icq(const char *sn) { - if (isalpha(sn[0])) - return FALSE; - return TRUE; + return aim_snvalid_icq(sn); } /** * Determine if a given screen name is an SMS number * (i.e. it begins with a +). * - * @sn A valid AIM or ICQ screen name. + * @param sn A valid AIM or ICQ screen name. * @return TRUE if the screen name is an SMS number. Otherwise * FALSE is returned. */ gboolean aim_sn_is_sms(const char *sn) { - if (sn[0] != '+') - return FALSE; - return TRUE; -} - -/** - * This takes a screen name and returns its length without - * spaces. If there are no spaces in the SN, then the - * return is equal to that of strlen(). - */ -int -aim_snlen(const char *sn) -{ - int i = 0; - - if (!sn) - return 0; - - while (*sn != '\0') { - if (*sn != ' ') - i++; - sn++; - } - - return i; + return (sn[0] == '+'); } /** @@ -279,9 +255,9 @@ * ignored, with the exception that screen names can not start with * a space). * - * Return: 0 if equal - * non-0 if different + * @return 0 if equal, non-0 if different */ +/* TODO: Do something different for email addresses. */ int aim_sncmp(const char *sn1, const char *sn2) {
--- a/libpurple/protocols/qq/Makefile.mingw Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/protocols/qq/Makefile.mingw Tue Jun 26 05:08:44 2007 +0000 @@ -54,7 +54,6 @@ group_im.c \ group_info.c \ group_join.c \ - group_misc.c \ group_network.c \ group_opt.c \ group_search.c \
--- a/libpurple/win32/win32dep.c Sun Jun 24 16:09:25 2007 +0000 +++ b/libpurple/win32/win32dep.c Tue Jun 26 05:08:44 2007 +0000 @@ -32,6 +32,7 @@ #include <glib.h> #include <glib/gstdio.h> +#include "internal.h" #include "debug.h" #include "notify.h"
--- a/pidgin/eggtrayicon.c Sun Jun 24 16:09:25 2007 +0000 +++ b/pidgin/eggtrayicon.c Tue Jun 26 05:08:44 2007 +0000 @@ -152,6 +152,26 @@ } } +static Display * +egg_tray_icon_get_x_display(EggTrayIcon *icon) +{ + Display *xdisplay = NULL; + +#if GTK_CHECK_VERSION(2,1,0) + { + GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (icon)); + if (!GDK_IS_DISPLAY (display)) + display = gdk_display_get_default (); + + xdisplay = GDK_DISPLAY_XDISPLAY (display); + } +#else + xdisplay = gdk_display; +#endif + + return xdisplay; +} + static void egg_tray_icon_get_orientation_property (EggTrayIcon *icon) { @@ -168,11 +188,10 @@ g_return_if_fail(icon->manager_window != None); -#if GTK_CHECK_VERSION(2,1,0) - xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); -#else - xdisplay = gdk_display; -#endif + xdisplay = egg_tray_icon_get_x_display(icon); + + if (xdisplay == NULL) + return; gdk_error_trap_push (); type = None; @@ -321,11 +340,10 @@ if (icon->manager_window != None) return; -#if GTK_CHECK_VERSION(2,1,0) - xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); -#else - xdisplay = gdk_display; -#endif + xdisplay = egg_tray_icon_get_x_display(icon); + + if (xdisplay == NULL) + return; XGrabServer (xdisplay); @@ -424,12 +442,15 @@ make_transparent (widget, NULL); + xdisplay = egg_tray_icon_get_x_display(icon); + + if (xdisplay == NULL) + return; + #if GTK_CHECK_VERSION(2,1,0) screen = gdk_screen_get_number (gtk_widget_get_screen (widget)); - xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget)); #else screen = XScreenNumberOfScreen (DefaultScreenOfDisplay (gdk_display)); - xdisplay = gdk_display; #endif /* Now see if there's a manager window around */ @@ -519,11 +540,10 @@ XClientMessageEvent ev; Display *xdisplay; -#if GTK_CHECK_VERSION(2,1,0) - xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon))); -#else - xdisplay = gdk_display; -#endif + xdisplay = egg_tray_icon_get_x_display(icon); + + if (xdisplay == NULL) + return; ev.type = ClientMessage; ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon));
--- a/pidgin/gtkblist.c Sun Jun 24 16:09:25 2007 +0000 +++ b/pidgin/gtkblist.c Tue Jun 26 05:08:44 2007 +0000 @@ -174,6 +174,7 @@ static gboolean gtk_blist_window_state_cb(GtkWidget *w, GdkEventWindowState *event, gpointer data) { +#if GTK_CHECK_VERSION(2,2,0) if(event->changed_mask & GDK_WINDOW_STATE_WITHDRAWN) { if(event->new_window_state & GDK_WINDOW_STATE_WITHDRAWN) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); @@ -195,6 +196,28 @@ if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)) pidgin_blist_refresh_timer(purple_get_blist()); } +#else + /* At least gtk+ 2.0.6 does not properly set the change_mask when unsetting a + * GdkWindowState flag. To work around, the window state will be explicitly + * queried on these older versions of gtk+. See pidgin ticket #739. + */ + GdkWindowState new_window_state = gdk_window_get_state(G_OBJECT(gtkblist->window->window)); + + if(new_window_state & GDK_WINDOW_STATE_WITHDRAWN) { + purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); + } else { + purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", TRUE); + pidgin_blist_refresh_timer(purple_get_blist()); + } + + if(new_window_state & GDK_WINDOW_STATE_MAXIMIZED) + purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", TRUE); + else + purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE); + + if (!(new_window_state & GDK_WINDOW_STATE_ICONIFIED)) + pidgin_blist_refresh_timer(purple_get_blist()); +#endif return FALSE; } @@ -2976,10 +2999,11 @@ signon = purple_presence_get_login_time(presence); if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0) { - if (time(NULL) - signon > 63072000 /* 2 years */) { + if (signon > time(NULL)) { /* - * Our local clock must be wrong, show the actual - * date instead of "4 days", etc. + * They signed on in the future?! Our local clock + * must be wrong, show the actual date instead of + * "4 days", etc. */ tmp = g_strdup(purple_date_format_long(localtime(&signon))); } else
--- a/pidgin/gtkprivacy.c Sun Jun 24 16:09:25 2007 +0000 +++ b/pidgin/gtkprivacy.c Tue Jun 26 05:08:44 2007 +0000 @@ -366,7 +366,7 @@ dialog = g_new0(PidginPrivacyDialog, 1); - dialog->win = pidgin_create_window(_("Privacy"), PIDGIN_HIG_BORDER, "privacy", FALSE); + dialog->win = pidgin_create_window(_("Privacy"), PIDGIN_HIG_BORDER, "privacy", TRUE); g_signal_connect(G_OBJECT(dialog->win), "delete_event", G_CALLBACK(destroy_cb), dialog);
--- a/pidgin/gtksavedstatuses.c Sun Jun 24 16:09:25 2007 +0000 +++ b/pidgin/gtksavedstatuses.c Tue Jun 26 05:08:44 2007 +0000 @@ -1140,7 +1140,7 @@ if (edit) dialog->original_title = g_strdup(purple_savedstatus_get_title(saved_status)); - dialog->window = win = pidgin_create_window (_("Status"), PIDGIN_HIG_BORDER, "status", FALSE) ; + dialog->window = win = pidgin_create_window(_("Status"), PIDGIN_HIG_BORDER, "status", TRUE); g_signal_connect(G_OBJECT(win), "delete_event", G_CALLBACK(status_editor_destroy_cb), dialog); @@ -1475,7 +1475,7 @@ dialog->account = account; tmp = g_strdup_printf(_("Status for %s"), purple_account_get_username(account)); - dialog->window = win = pidgin_create_window(tmp, PIDGIN_HIG_BORDER, "substatus", FALSE) ; + dialog->window = win = pidgin_create_window(tmp, PIDGIN_HIG_BORDER, "substatus", TRUE); g_free(tmp); g_signal_connect(G_OBJECT(win), "delete_event", @@ -1520,7 +1520,7 @@ /* Status mesage */ hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); label = gtk_label_new_with_mnemonic(_("_Message:")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
--- a/pidgin/gtkstatusbox.c Sun Jun 24 16:09:25 2007 +0000 +++ b/pidgin/gtkstatusbox.c Tue Jun 26 05:08:44 2007 +0000 @@ -1016,8 +1016,8 @@ } } -static void -pidgin_status_box_regenerate(PidginStatusBox *status_box) +static gboolean +pidgin_status_box_regenerate_real(PidginStatusBox *status_box) { GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4, *pixbuf5; GtkIconSize icon_size; @@ -1081,11 +1081,21 @@ } gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), GTK_TREE_MODEL(status_box->dropdown_store)); gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); + + return FALSE; +} + +static void +pidgin_status_box_regenerate(PidginStatusBox *status_box) +{ + /* we have to do this in a timeout, so we avoid recursing + * to infinity (and beyond) */ + purple_timeout_add(0, (GSourceFunc)pidgin_status_box_regenerate_real, status_box); } static gboolean combo_box_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml) { - pidgin_status_box_popup(PIDGIN_STATUS_BOX(w)); + pidgin_status_box_popup(PIDGIN_STATUS_BOX(w)); return TRUE; }