# HG changeset patch # User Sadrul Habib Chowdhury # Date 1183274116 0 # Node ID 8ee1f173253cdea198df950d57319d7f1b13c6d8 # Parent 238086459dc48be40365875c4cc9a0d1895346e6# Parent bf026a5800dbe059d13bed0ccec1f35bb78489fc merge of '414f0770611139752d484f4831cb59038456c9bf' and 'ac9248515df0eeec749075d5b6242b285cf57967' diff -r bf026a5800db -r 8ee1f173253c libpurple/dbus-useful.c diff -r bf026a5800db -r 8ee1f173253c libpurple/debug.c diff -r bf026a5800db -r 8ee1f173253c libpurple/dnssrv.c --- a/libpurple/dnssrv.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/dnssrv.c Sun Jul 01 07:15:16 2007 +0000 @@ -50,11 +50,11 @@ u_char buf[1024]; } queryans; #else -static DNS_STATUS WINAPI (*MyDnsQuery_UTF8) ( +static DNS_STATUS (WINAPI *MyDnsQuery_UTF8) ( PCSTR lpstrName, WORD wType, DWORD fOptions, PIP4_ARRAY aipServers, PDNS_RECORD* ppQueryResultsSet, PVOID* pReserved) = NULL; -static void WINAPI (*MyDnsRecordListFree) (PDNS_RECORD pRecordList, +static void (WINAPI *MyDnsRecordListFree) (PDNS_RECORD pRecordList, DNS_FREE_TYPE FreeType) = NULL; #endif diff -r bf026a5800db -r 8ee1f173253c libpurple/internal.h --- a/libpurple/internal.h Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/internal.h Sun Jul 01 07:15:16 2007 +0000 @@ -111,11 +111,16 @@ # include #endif -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 1024 +/* MAXPATHLEN should only be used with readlink() on glib < 2.4.0. For + * anything else, use g_file_read_link() or other dynamic functions. This is + * important because Hurd has no hard limits on path length. */ +#if !GLIB_CHECK_VERSION(2,4,0) +# ifndef MAXPATHLEN +# ifdef PATH_MAX +# define MAXPATHLEN PATH_MAX +# else +# define MAXPATHLEN 1024 +# endif # endif #endif diff -r bf026a5800db -r 8ee1f173253c libpurple/network.c --- a/libpurple/network.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/network.c Sun Jul 01 07:15:16 2007 +0000 @@ -517,7 +517,7 @@ WSAQUERYSET qs; time_t last_trigger = time(NULL); - int WSAAPI (*MyWSANSPIoctl) ( + int (WSAAPI *MyWSANSPIoctl) ( HANDLE hLookup, DWORD dwControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSACOMPLETION lpCompletion) = NULL; diff -r bf026a5800db -r 8ee1f173253c libpurple/plugins/filectl.c --- a/libpurple/plugins/filectl.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/plugins/filectl.c Sun Jul 01 07:15:16 2007 +0000 @@ -56,7 +56,7 @@ purple_debug_misc("filectl", "read: %s\n", buffer); command = getarg(buffer, 0, 0); - if (!strncasecmp(command, "login", 6)) { + if (!g_ascii_strncasecmp(command, "login", 6)) { PurpleAccount *account; arg1 = getarg(buffer, 1, 0); @@ -69,7 +69,7 @@ free(arg1); free(arg2); - } else if (!strncasecmp(command, "logout", 7)) { + } else if (!g_ascii_strncasecmp(command, "logout", 7)) { PurpleAccount *account; arg1 = getarg(buffer, 1, 1); @@ -88,7 +88,7 @@ /* purple_find_conversation() is gone in 2.0.0. */ #if 0 - } else if (!strncasecmp(command, "send", 4)) { + } else if (!g_ascii_strncasecmp(command, "send", 4)) { PurpleConversation *conv; arg1 = getarg(buffer, 1, 0); @@ -107,21 +107,21 @@ free(arg2); #endif - } else if (!strncasecmp(command, "away", 4)) { + } else if (!g_ascii_strncasecmp(command, "away", 4)) { arg1 = getarg(buffer, 1, 1); /* serv_set_away_all(arg1); */ free(arg1); - } else if (!strncasecmp(command, "hide", 4)) { + } else if (!g_ascii_strncasecmp(command, "hide", 4)) { purple_blist_set_visible(FALSE); - } else if (!strncasecmp(command, "unhide", 6)) { + } else if (!g_ascii_strncasecmp(command, "unhide", 6)) { purple_blist_set_visible(TRUE); - } else if (!strncasecmp(command, "back", 4)) { + } else if (!g_ascii_strncasecmp(command, "back", 4)) { /* do_im_back(); */ - } else if (!strncasecmp(command, "quit", 4)) { + } else if (!g_ascii_strncasecmp(command, "quit", 4)) { purple_core_quit(); } diff -r bf026a5800db -r 8ee1f173253c libpurple/plugins/perl/common/Connection.xs diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/gg/lib/http.c --- a/libpurple/protocols/gg/lib/http.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/gg/lib/http.c Sun Jul 01 07:15:16 2007 +0000 @@ -349,7 +349,7 @@ gg_debug(GG_DEBUG_MISC, "=> -----BEGIN-HTTP-HEADER-----\n%s\n=> -----END-HTTP-HEADER-----\n", h->header); while (line) { - if (!strncasecmp(line, "Content-length: ", 16)) { + if (!g_ascii_strncasecmp(line, "Content-length: ", 16)) { h->body_size = atoi(line + 16); } line = strchr(line, '\n'); diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/gg/lib/pubdir50.c --- a/libpurple/protocols/gg/lib/pubdir50.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/gg/lib/pubdir50.c Sun Jul 01 07:15:16 2007 +0000 @@ -347,7 +347,7 @@ /* jeśli dostaliśmy namier na następne wyniki, to znaczy że * mamy koniec wyników i nie jest to kolejna osoba. */ - if (!strcasecmp(field, "nextstart")) { + if (!g_ascii_strcasecmp(field, "nextstart")) { res->next = atoi(value); num--; } else { @@ -390,7 +390,7 @@ } for (i = 0; i < res->entries_count; i++) { - if (res->entries[i].num == num && !strcasecmp(res->entries[i].field, field)) { + if (res->entries[i].num == num && !g_ascii_strcasecmp(res->entries[i].field, field)) { value = res->entries[i].value; break; } diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/jabber/jutil.c diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/msn/msn-utils.c --- a/libpurple/protocols/msn/msn-utils.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/msn/msn-utils.c Sun Jul 01 07:15:16 2007 +0000 @@ -296,7 +296,7 @@ char *attr_dir; attributes = g_strndup(c, attr_len); attr_dir = purple_markup_get_css_property(attributes, "direction"); - if (attr_dir && (!strncasecmp(attr_dir, "RTL", 3))) + if (attr_dir && (!g_ascii_strncasecmp(attr_dir, "RTL", 3))) direction = '1'; g_free(attr_dir); g_free(attributes); diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/oscar/odc.c --- a/libpurple/protocols/oscar/odc.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/oscar/odc.c Sun Jul 01 07:15:16 2007 +0000 @@ -314,7 +314,7 @@ tmp += size; /* Skip past the closing tag */ - if (strncasecmp(tmp, "", 7)) + if (g_ascii_strncasecmp(tmp, "", 7)) { g_free(embedded_data); break; diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/silc/buddy.c --- a/libpurple/protocols/silc/buddy.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/silc/buddy.c Sun Jul 01 07:15:16 2007 +0000 @@ -1252,7 +1252,7 @@ SilcClientEntry entry; silc_dlist_start(clients); while ((entry = silc_dlist_get(clients))) { - if (!strncasecmp(b->name, entry->nickname, + if (!g_ascii_strncasecmp(b->name, entry->nickname, strlen(b->name))) { client_entry = entry; break; diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/silc/util.c --- a/libpurple/protocols/silc/util.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/silc/util.c Sun Jul 01 07:15:16 2007 +0000 @@ -623,15 +623,15 @@ ct = strrchr(filename, '.'); if (!ct) return NULL; - else if (!strcasecmp(".png", ct)) + else if (!g_ascii_strcasecmp(".png", ct)) return strdup("image/png"); - else if (!strcasecmp(".jpg", ct)) + else if (!g_ascii_strcasecmp(".jpg", ct)) return strdup("image/jpeg"); - else if (!strcasecmp(".jpeg", ct)) + else if (!g_ascii_strcasecmp(".jpeg", ct)) return strdup("image/jpeg"); - else if (!strcasecmp(".gif", ct)) + else if (!g_ascii_strcasecmp(".gif", ct)) return strdup("image/gif"); - else if (!strcasecmp(".tiff", ct)) + else if (!g_ascii_strcasecmp(".tiff", ct)) return strdup("image/tiff"); return NULL; diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/silc10/buddy.c --- a/libpurple/protocols/silc10/buddy.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/silc10/buddy.c Sun Jul 01 07:15:16 2007 +0000 @@ -1246,7 +1246,7 @@ buddy nickname. */ int i; for (i = 0; i < clients_count; i++) { - if (!strncasecmp(b->name, clients[i]->nickname, + if (!g_ascii_strncasecmp(b->name, clients[i]->nickname, strlen(b->name))) { clients[0] = clients[i]; break; diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/simple/simple.c --- a/libpurple/protocols/simple/simple.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/simple/simple.c Sun Jul 01 07:15:16 2007 +0000 @@ -337,7 +337,7 @@ return; } - if(!g_strncasecmp(hdr, "NTLM", 4)) { + if(!g_ascii_strncasecmp(hdr, "NTLM", 4)) { purple_debug_info("simple", "found NTLM\n"); auth->type = 2; parts = g_strsplit(hdr+5, "\", ", 0); diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/yahoo/yahoo_picture.c --- a/libpurple/protocols/yahoo/yahoo_picture.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Sun Jul 01 07:15:16 2007 +0000 @@ -110,7 +110,7 @@ } /* Yahoo IM 6 spits out 0.png as the URL if the buddy icon is not set */ - if (who && got_icon_info && url && !strncasecmp(url, "http://", 7)) { + if (who && got_icon_info && url && !g_ascii_strncasecmp(url, "http://", 7)) { /* TODO: make this work p2p, try p2p before the url */ PurpleUtilFetchUrlData *url_data; struct yahoo_fetch_picture_data *data; diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/yahoo/yahoochat.h diff -r bf026a5800db -r 8ee1f173253c libpurple/protocols/zephyr/ZVariables.c --- a/libpurple/protocols/zephyr/ZVariables.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/protocols/zephyr/ZVariables.c Sun Jul 01 07:15:16 2007 +0000 @@ -186,7 +186,7 @@ #define max(a,b) ((a > b) ? (a) : (b)) #endif - if (strncasecmp(bfr, var, max(strlen(var),cp - bfr))) + if (g_strncasecmp(bfr, var, max(strlen(var), cp - bfr))) return(0); /* var is not the var in bfr ==> no match */ diff -r bf026a5800db -r 8ee1f173253c libpurple/util.c --- a/libpurple/util.c Sun Jul 01 04:03:37 2007 +0000 +++ b/libpurple/util.c Sun Jul 01 07:15:16 2007 +0000 @@ -1730,7 +1730,7 @@ if (cdata_close_tag) { /* Note: Don't even assume any other tag is a tag in CDATA */ - if (strncasecmp(str2 + i, cdata_close_tag, + if (g_ascii_strncasecmp(str2 + i, cdata_close_tag, strlen(cdata_close_tag)) == 0) { i += strlen(cdata_close_tag) - 1; @@ -1738,12 +1738,12 @@ } continue; } - else if (strncasecmp(str2 + i, "", 5) == 0) + else if (g_ascii_strncasecmp(str2 + i, "", 5) == 0) { closing_td_p = TRUE; visible = FALSE; @@ -1771,7 +1771,7 @@ /* If we've got an tag with an href, save the address * to print later. */ - if (strncasecmp(str2 + i, " with an ascii representation of the * address the link was pointing to. */ - else if (href != NULL && strncasecmp(str2 + i, "", 4) == 0) + else if (href != NULL && g_ascii_strncasecmp(str2 + i, "", 4) == 0) { size_t hrlen = strlen(href); @@ -1834,29 +1834,29 @@ } /* Check for tags which should be mapped to newline */ - else if (strncasecmp(str2 + i, "

", 3) == 0 - || strncasecmp(str2 + i, "", 8) == 0) + else if (g_ascii_strncasecmp(str2 + i, "

", 3) == 0 + || g_ascii_strncasecmp(str2 + i, "", 8) == 0) { str2[j++] = '\n'; } /* Check for tags which begin CDATA and need to be closed */ #if 0 /* FIXME.. option is end tag optional, we can't handle this right now */ - else if (strncasecmp(str2 + i, " +#ifdef _MSC_VER +#define S_IRUSR S_IREAD +#define S_IWUSR S_IWRITE +#define S_IXUSR S_IEXEC + +#define S_ISDIR(m) (((m)&S_IFDIR)==S_IFDIR) + +#define F_OK 0 +#endif + /* sys/socket.h */ #define socket( namespace, style, protocol ) \ wpurple_socket( namespace, style, protocol ) @@ -36,11 +46,11 @@ #define connect( socket, addr, length ) \ wpurple_connect( socket, addr, length ) -#define getsockopt( args... ) \ -wpurple_getsockopt( args ) +#define getsockopt( socket, level, optname, optval, optlenptr ) \ +wpurple_getsockopt( socket, level, optname, optval, optlenptr ) -#define setsockopt( args... ) \ -wpurple_setsockopt( args ) +#define setsockopt( socket, level, optname, optval, optlen ) \ +wpurple_setsockopt( socket, level, optname, optval, optlen ) #define getsockname( socket, addr, lenptr ) \ wpurple_getsockname( socket, addr, lenptr ) diff -r bf026a5800db -r 8ee1f173253c pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sun Jul 01 04:03:37 2007 +0000 +++ b/pidgin/gtkblist.c Sun Jul 01 07:15:16 2007 +0000 @@ -2873,7 +2873,11 @@ { N_("/_Help"), NULL, NULL, 0, "", NULL }, { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "", GTK_STOCK_HELP }, { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "", NULL }, +#if GTK_CHECK_VERSION(2,6,0) + { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "", GTK_STOCK_ABOUT }, +#else { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "", NULL }, +#endif }; /********************************************************* diff -r bf026a5800db -r 8ee1f173253c pidgin/gtkdocklet.c diff -r bf026a5800db -r 8ee1f173253c pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Sun Jul 01 04:03:37 2007 +0000 +++ b/pidgin/gtkimhtml.c Sun Jul 01 07:15:16 2007 +0000 @@ -2162,7 +2162,7 @@ gint i; for(i=0; i + static GtkHBoxClass *parent_class = NULL; static void toggle_button_set_active_block(GtkToggleButton *button, @@ -629,7 +631,6 @@ return ls; } - static gboolean smiley_is_unique(GSList *list, GtkIMHtmlSmiley *smiley) { @@ -642,6 +643,18 @@ return TRUE; } +static gboolean +smiley_dialog_input_cb(GtkWidget *dialog, GdkEvent *event, GtkIMHtmlToolbar *toolbar) +{ + if ((event->type == GDK_KEY_PRESS && event->key.keyval == GDK_Escape) || + (event->type == GDK_BUTTON_PRESS && event->button.button == 1)) + { + close_smiley_dialog(NULL, NULL, toolbar); + return TRUE; + } + + return FALSE; +} static void insert_smiley_cb(GtkWidget *smiley, GtkIMHtmlToolbar *toolbar) @@ -720,11 +733,16 @@ free(it_tmp); } gtk_box_pack_start(GTK_BOX(smiley_table), line, FALSE, TRUE, 0); + + gtk_widget_add_events(dialog, GDK_KEY_PRESS_MASK); } else { smiley_table = gtk_label_new(_("This theme has no available smileys.")); + gtk_widget_add_events(dialog, GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK); + g_signal_connect(G_OBJECT(dialog), "button-press-event", (GCallback)smiley_dialog_input_cb, toolbar); } + g_signal_connect(G_OBJECT(dialog), "key-press-event", (GCallback)smiley_dialog_input_cb, toolbar); gtk_container_add(GTK_CONTAINER(dialog), smiley_table); gtk_widget_show(smiley_table); diff -r bf026a5800db -r 8ee1f173253c pidgin/gtklog.c diff -r bf026a5800db -r 8ee1f173253c pidgin/gtkprefs.c --- a/pidgin/gtkprefs.c Sun Jul 01 04:03:37 2007 +0000 +++ b/pidgin/gtkprefs.c Sun Jul 01 07:15:16 2007 +0000 @@ -381,7 +381,8 @@ themename = g_value_get_string(&val); purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", themename); - gtk_widget_set_sensitive(remove_button, strcmp(themename, "none")); + gtk_widget_set_sensitive(remove_button, (strcmp(themename, "none") && + strcmp(themename, _("Default")))); g_value_unset (&val); /* current_smiley_theme is set in callback for the above pref change */ diff -r bf026a5800db -r 8ee1f173253c pidgin/plugins/gestures/gestures.c diff -r bf026a5800db -r 8ee1f173253c pidgin/plugins/notify.c diff -r bf026a5800db -r 8ee1f173253c pidgin/plugins/spellchk.c --- a/pidgin/plugins/spellchk.c Sun Jul 01 04:03:37 2007 +0000 +++ b/pidgin/plugins/spellchk.c Sun Jul 01 07:15:16 2007 +0000 @@ -45,9 +45,6 @@ #include #include -#ifndef _WIN32 -#include -#endif #include #include @@ -1787,19 +1784,19 @@ while (buf_get_line(ibuf, &buf, &pnt, size)) { if (*buf != '#') { - if (!strncasecmp(buf, "BAD ", 4)) + if (!g_ascii_strncasecmp(buf, "BAD ", 4)) { strncpy(bad, buf + 4, 81); } - else if(!strncasecmp(buf, "CASE ", 5)) + else if(!g_ascii_strncasecmp(buf, "CASE ", 5)) { case_sensitive = *(buf+5) == '0' ? FALSE : TRUE; } - else if(!strncasecmp(buf, "COMPLETE ", 9)) + else if(!g_ascii_strncasecmp(buf, "COMPLETE ", 9)) { complete = *(buf+9) == '0' ? FALSE : TRUE; } - else if (!strncasecmp(buf, "GOOD ", 5)) + else if (!g_ascii_strncasecmp(buf, "GOOD ", 5)) { strncpy(good, buf + 5, 255); diff -r bf026a5800db -r 8ee1f173253c pidgin/plugins/timestamp.c