# HG changeset patch # User Sadrul Habib Chowdhury # Date 1190381261 0 # Node ID 707cd521188ae73ba4bc1bbcdb415eab68e7be8b # Parent 485a0bffe4f51fc4322ac48f4dd1c16ec6c26a2e# Parent ec11c8ec03054bc72207822555b7256d4c782ac2 propagate from branch 'im.pidgin.pidgin' (head e67a54b3bf4349b6e65a46f749626a122c6afb22) to branch 'im.pidgin.sadrul.currentmedia' (head d3dc349e84591135f4f729a4e169ca65e48fc6e2) diff -r 485a0bffe4f5 -r 707cd521188a ChangeLog --- a/ChangeLog Fri Sep 21 02:11:29 2007 +0000 +++ b/ChangeLog Fri Sep 21 13:27:41 2007 +0000 @@ -34,6 +34,7 @@ * Pidgin's display is now saved with the command line for session restoration. (David Mohr) * You should no longer lose proxy settings when Pidgin is restarted. + * ICQ Birthday notifications are shown as buddy list emblems Version 2.2.0 (09/13/2007): http://developer.pidgin.im/query?status=closed&milestone=2.2.0 diff -r 485a0bffe4f5 -r 707cd521188a doc/funniest_home_convos.txt --- a/doc/funniest_home_convos.txt Fri Sep 21 02:11:29 2007 +0000 +++ b/doc/funniest_home_convos.txt Fri Sep 21 13:27:41 2007 +0000 @@ -487,3 +487,21 @@ established that 19:03 its functioning just fine +-- + +17:12 I think I foundage a bug +17:13 I don't think blocking works correctly for the AIM protocol +17:13 because a girl attempted to block me in pidgin and I can still + talk to her +17:14 [screen name expunged]: I already told you yesterday. You don't + need me to ease your mind, you want me to change MY mind. Well, + you're out of luck. I don't know how you're still messaging me, + because I already blocked you, but I demand you stop immediately. + For now on, I will save every message that you send me as + evidence for the next time I decide to call the police. I did + call them yesterday, but I didn't have evidence. The more you + message me now, the more you're digging you're own grave, so I + advice you to stop. +17:14 see? +17:16 I think blocking in pidgin not working is not your biggest + problem here. diff -r 485a0bffe4f5 -r 707cd521188a libpurple/ft.c --- a/libpurple/ft.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/ft.c Fri Sep 21 13:27:41 2007 +0000 @@ -67,6 +67,7 @@ xfer->ui_ops = purple_xfers_get_ui_ops(); xfer->message = NULL; xfer->current_buffer_size = FT_INITIAL_BUFFER_SIZE; + xfer->fd = -1; ui_ops = purple_xfer_get_ui_ops(xfer); diff -r 485a0bffe4f5 -r 707cd521188a libpurple/notify.c --- a/libpurple/notify.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/notify.c Fri Sep 21 13:27:41 2007 +0000 @@ -150,8 +150,6 @@ { PurpleNotifyUiOps *ops; - g_return_val_if_fail(count != 0, NULL); - if (count == 1) { return purple_notify_email(handle, (subjects == NULL ? NULL : *subjects), @@ -506,7 +504,7 @@ g_return_if_fail(user_info_entry != NULL); g_free(user_info_entry->label); - g_free(user_info_entry->value); + g_free(user_info_entry->value); PURPLE_DBUS_UNREGISTER_POINTER(user_info_entry); g_free(user_info_entry); } @@ -568,7 +566,7 @@ if (user_info_entry->label && user_info_entry->value) g_string_append(text, ": "); if (user_info_entry->value) - g_string_append(text, user_info_entry->value); + g_string_append(text, user_info_entry->value); /* Display a section break as a horizontal line */ if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK) diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Sep 21 13:27:41 2007 +0000 @@ -1656,8 +1656,10 @@ if(!strcmp(ns, "jabber:iq:last")) { if(!strcmp(jbr->client.name, "Trillian")) { - if(!strcmp(jbr->client.version, "3.1.0.121")) { - /* verified by nwalp 2007/05/09 */ + /* verified by nwalp 2007/05/09 */ + if(!strcmp(jbr->client.version, "3.1.0.121") || + /* verified by nwalp 2007/09/19 */ + !strcmp(jbr->client.version, "3.1.7.0")) { return TRUE; } } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/jabber/google.c --- a/libpurple/protocols/jabber/google.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/jabber/google.c Fri Sep 21 13:27:41 2007 +0000 @@ -61,14 +61,9 @@ to = xmlnode_get_attrib(packet, "to"); default_tos[0] = jabber_get_bare_jid(to); - if (count == 0) { - purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL); - g_free(default_tos[0]); - return; - } + message = xmlnode_get_child(child, "mail-thread-info"); - message = xmlnode_get_child(child, "mail-thread-info"); - if (!message) { + if (count == 0 || !message) { purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL); g_free(default_tos[0]); return; @@ -127,7 +122,7 @@ if (i>0) purple_notify_emails(js->gc, count, count == i, (const char**) subjects, froms, tos, urls, NULL, NULL); - else + else purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL); @@ -257,7 +252,8 @@ if (grt && (*grt == 'H' || *grt == 'h')) { PurpleBuddy *buddy = purple_find_buddy(account, jid_norm); - purple_blist_remove_buddy(buddy); + if (buddy) + purple_blist_remove_buddy(buddy); g_free(jid_norm); return FALSE; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/jabber/iq.c --- a/libpurple/protocols/jabber/iq.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/jabber/iq.c Fri Sep 21 13:27:41 2007 +0000 @@ -255,7 +255,7 @@ if(type && !strcmp(type, "get")) { GHashTable *ui_info; const char *ui_name = NULL, *ui_version = NULL; - +#if 0 if(!purple_prefs_get_bool("/plugins/prpl/jabber/hide_os")) { struct utsname osinfo; @@ -263,7 +263,7 @@ os = g_strdup_printf("%s %s %s", osinfo.sysname, osinfo.release, osinfo.machine); } - +#endif from = xmlnode_get_attrib(packet, "from"); id = xmlnode_get_attrib(packet, "id"); diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/msn/directconn.c --- a/libpurple/protocols/msn/directconn.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/msn/directconn.c Fri Sep 21 13:27:41 2007 +0000 @@ -418,6 +418,15 @@ } } +static void +directconn_connect_cb(gpointer data, gint source, const gchar *error_message) +{ + if (error_message) + purple_debug_error("msn", "Error making direct connection: %s\n", error_message); + + connect_cb(data, source, PURPLE_INPUT_READ); +} + gboolean msn_directconn_connect(MsnDirectConn *directconn, const char *host, int port) { @@ -437,14 +446,9 @@ #endif directconn->connect_data = purple_proxy_connect(NULL, session->account, - host, port, connect_cb, directconn); + host, port, directconn_connect_cb, directconn); - if (directconn->connect_data != NULL) - { - return TRUE; - } - else - return FALSE; + return (directconn->connect_data != NULL); } void diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/msn/httpconn.c --- a/libpurple/protocols/msn/httpconn.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/msn/httpconn.c Fri Sep 21 13:27:41 2007 +0000 @@ -663,6 +663,8 @@ httpconn->tx_buf = purple_circ_buffer_new(MSN_BUF_LEN); httpconn->tx_handler = 0; + httpconn->fd = -1; + return httpconn; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/msn/servconn.c --- a/libpurple/protocols/msn/servconn.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/msn/servconn.c Fri Sep 21 13:27:41 2007 +0000 @@ -53,6 +53,8 @@ servconn->tx_buf = purple_circ_buffer_new(MSN_BUF_LEN); servconn->tx_handler = 0; + serconn->fd = -1; + return servconn; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/msn/session.c --- a/libpurple/protocols/msn/session.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/msn/session.c Fri Sep 21 13:27:41 2007 +0000 @@ -269,7 +269,7 @@ /* The core used to use msn_add_buddy to add all buddies before * being logged in. This no longer happens, so we manually iterate - * over the whole buddy list to identify sync issues. + * over the whole buddy list to identify sync issues. */ for (gnode = purple_get_blist()->root; gnode; gnode = gnode->next) { PurpleGroup *group = (PurpleGroup *)gnode; @@ -342,6 +342,8 @@ case MSN_ERROR_SIGN_OTHER: gc->wants_to_die = TRUE; msg = g_strdup(_("You have signed on from another location.")); + if (!purple_account_get_remember_password(session->account)) + purple_account_set_password(session->account, NULL); break; case MSN_ERROR_SERV_UNAVAILABLE: msg = g_strdup(_("The MSN servers are temporarily " diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/msn/userlist.c --- a/libpurple/protocols/msn/userlist.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/msn/userlist.c Fri Sep 21 13:27:41 2007 +0000 @@ -133,6 +133,7 @@ return FALSE; } +#if 0 static const char* get_store_name(MsnUser *user) { @@ -160,6 +161,7 @@ return store_name; } +#endif /************************************************************************** * Server functions diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Fri Sep 21 13:27:41 2007 +0000 @@ -1784,11 +1784,13 @@ /* Destroy session if fatal. */ if (msim_msg_get(msg, "fatal")) { purple_debug_info("msim", "fatal error, closing\n"); - if (err == 260) { - /* Incorrect password */ - session->gc->wants_to_die = TRUE; - if (!purple_account_get_remember_password(session->account)) - purple_account_set_password(session->account, NULL); + switch (err) { + case 260: /* Incorrect password */ + case 6: /* Logged in elsewhere */ + session->gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(session->account)) + purple_account_set_password(session->account, NULL); + break; } purple_connection_error(session->gc, full_errmsg); } else { diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/novell/novell.c --- a/libpurple/protocols/novell/novell.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/novell/novell.c Fri Sep 21 13:27:41 2007 +0000 @@ -130,6 +130,8 @@ if (ret_code == NMERR_AUTHENTICATION_FAILED || ret_code == NMERR_CREDENTIALS_MISSING || ret_code == NMERR_PASSWORD_INVALID) { + if (!purple_account_get_remember_password(gc->account)) + purple_account_set_password(gc->account, NULL); gc->wants_to_die = TRUE; } purple_connection_error(gc, err); @@ -2004,11 +2006,14 @@ _evt_user_disconnect(NMUser * user, NMEvent * event) { PurpleConnection *gc; - - gc = purple_account_get_connection((PurpleAccount *) user->client_data); + PurpleAccount *account = user->client_data; + + gc = purple_account_get_connection(account); if (gc) { gc->wants_to_die = TRUE; /* we don't want to reconnect in this case */ + if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); purple_connection_error(gc, _("You have been logged out because you" " logged in at another workstation.")); } @@ -2799,7 +2804,7 @@ const char *text = NULL; if (buddy == NULL) - return; + return; gc = purple_account_get_connection(buddy->account); if (gc == NULL || (user = gc->proto_data) == NULL) diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/oscar/flap_connection.c --- a/libpurple/protocols/oscar/flap_connection.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Fri Sep 21 13:27:41 2007 +0000 @@ -382,6 +382,8 @@ gchar *tmp; if (conn->disconnect_code == 0x0001) { tmp = g_strdup(_("You have signed on from another location.")); + if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); od->gc->wants_to_die = TRUE; } else if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_CLOSED) tmp = g_strdup(_("Server closed the connection.")); diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Fri Sep 21 13:27:41 2007 +0000 @@ -5507,6 +5507,8 @@ return "hiptop"; if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) return "secure"; + if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) + return "birthday"; } return NULL; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/qq/login_logout.c --- a/libpurple/protocols/qq/login_logout.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/qq/login_logout.c Fri Sep 21 13:27:41 2007 +0000 @@ -480,6 +480,8 @@ switch (ret) { case QQ_LOGIN_REPLY_PWD_ERROR: gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(gc->account)) + purple_account_set_password(gc->account, NULL); purple_connection_error(gc, _("Incorrect password.")); break; case QQ_LOGIN_REPLY_MISC_ERROR: diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/simple/simple.c --- a/libpurple/protocols/simple/simple.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/simple/simple.c Fri Sep 21 13:27:41 2007 +0000 @@ -695,7 +695,7 @@ static void do_register_exp(struct simple_account_data *sip, int expire) { char *uri, *to, *contact, *hdr; - /* Set our default expiration to 900, + /* Set our default expiration to 900, * as done in the initialization of the simple_account_data * structure. */ @@ -1042,6 +1042,8 @@ if(sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) { purple_debug_info("simple", "Setting wants_to_die to true.\n"); sip->gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(sip->gc->account)) + purple_account_set_password(sip->gc->account, NULL); purple_connection_error(sip->gc, _("Incorrect password.")); return TRUE; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Fri Sep 21 13:27:41 2007 +0000 @@ -202,6 +202,8 @@ if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) { gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); purple_connection_error(gc, _("You have signed on from another location.")); return; } @@ -4087,12 +4089,12 @@ { return TRUE; } - + gboolean yahoo_send_attention(PurpleConnection *gc, const char *username, guint type) { PurpleConversation *c; - c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, + c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, username, gc->account); g_return_val_if_fail(c != NULL, FALSE); @@ -4117,7 +4119,7 @@ attn->incoming_description = _("%s has buzzed you!"); attn->outgoing_description = _("Buzzing %s..."); list = g_list_append(list, attn); - } + } return list; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/protocols/yahoo/yahoo_aliases.c --- a/libpurple/protocols/yahoo/yahoo_aliases.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_aliases.c Fri Sep 21 13:27:41 2007 +0000 @@ -45,7 +45,7 @@ */ struct callback_data { PurpleConnection *gc; - const char *id; + char *id; }; @@ -56,11 +56,16 @@ static void yahoo_fetch_aliases_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data,const gchar *url_text, size_t len, const gchar *error_message) { + struct callback_data *cb = user_data; + PurpleConnection *gc = cb->gc; + struct yahoo_data *yd = gc->proto_data; + + yd->url_datas = g_slist_remove(yd->url_datas, url_data); + if (len == 0) { purple_debug_info("yahoo","No Aliases to process\n"); } else { const char *yid, *full_name, *nick_name, *alias, *id, *fn, *ln, *nn; - struct callback_data *cb = user_data; PurpleBuddy *b = NULL; xmlnode *item, *contacts; @@ -123,8 +128,9 @@ } } xmlnode_free(contacts); - g_free(cb); } + g_free(cb->id); + g_free(cb); } void @@ -134,6 +140,7 @@ struct callback_data *cb; char *url, *request, *webpage, *webaddress, *strtmp; int inttmp; + PurpleUtilFetchUrlData *url_data; /* Using callback_data so I have access to gc in the callback function */ cb = g_new0(struct callback_data, 1); @@ -150,7 +157,12 @@ webpage, yd->cookie_t,yd->cookie_y, webaddress); /* We have a URL and some header information, let's connect and get some aliases */ - purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_fetch_aliases_cb, cb); + url_data = purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_fetch_aliases_cb, cb); + if (url_data != NULL) { + yd->url_datas = g_slist_prepend(yd->url_datas, url_data); + } else { + g_free(cb); + } g_free(url); g_free(request); @@ -165,6 +177,11 @@ { xmlnode *node, *result; struct callback_data *cb = user_data; + PurpleConnection *gc = cb->gc; + struct yahoo_data *yd; + + yd = gc->proto_data; + yd->url_datas = g_slist_remove(yd->url_datas, url_data); result = xmlnode_from_str(url_text, -1); @@ -184,6 +201,7 @@ purple_debug_info("yahoo", "Alias update failed (No contact record returned)\n"); } + g_free(cb->id); g_free(cb); xmlnode_free(result); } @@ -197,6 +215,7 @@ int inttmp; struct callback_data *cb; PurpleBuddy *buddy; + PurpleUtilFetchUrlData *url_data; g_return_if_fail(alias!= NULL); g_return_if_fail(who!=NULL); @@ -216,6 +235,7 @@ /* Using callback_data so I have access to gc in the callback function */ cb = g_new0(struct callback_data, 1); cb->id = g_strdup(yu->id); + cb->gc = gc; /* Build all the info to make the web request */ url = g_strdup(YAHOO_ALIAS_UPDATE_URL); @@ -236,7 +256,13 @@ strlen(content), content); /* We have a URL and some header information, let's connect and update the alias */ - purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_update_alias_cb, cb); + url_data = purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_update_alias_cb, cb); + if (url_data != NULL) { + yd->url_datas = g_slist_prepend(yd->url_datas, url_data); + } else { + g_free(cb->id); + g_free(cb); + } g_free(content); g_free(url); diff -r 485a0bffe4f5 -r 707cd521188a libpurple/prpl.c --- a/libpurple/prpl.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/prpl.c Fri Sep 21 13:27:41 2007 +0000 @@ -226,6 +226,9 @@ { if (!purple_account_is_disconnected(account)) purple_account_disconnect(account); + /* Clear out the unsaved password if we're already disconnected and we switch to offline status */ + else if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); return; } diff -r 485a0bffe4f5 -r 707cd521188a libpurple/util.c --- a/libpurple/util.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/util.c Fri Sep 21 13:27:41 2007 +0000 @@ -1526,7 +1526,8 @@ while(*p && *p != '>') { if(!g_ascii_strncasecmp(p, "href=", strlen("href="))) { const char *q = p + strlen("href="); - g_string_free(url, TRUE); + if (url) + g_string_free(url, TRUE); url = g_string_new(""); cdata = g_string_new(""); if(*q == '\'' || *q == '\"') @@ -3853,6 +3854,7 @@ gfud->full = full; gfud->request = g_strdup(request); gfud->include_headers = include_headers; + gfud->fd = -1; purple_url_parse(url, &gfud->website.address, &gfud->website.port, &gfud->website.page, &gfud->website.user, &gfud->website.passwd); diff -r 485a0bffe4f5 -r 707cd521188a libpurple/win32/win32dep.c --- a/libpurple/win32/win32dep.c Fri Sep 21 02:11:29 2007 +0000 +++ b/libpurple/win32/win32dep.c Fri Sep 21 13:27:41 2007 +0000 @@ -43,7 +43,6 @@ /* * DEFINES & MACROS */ -#define WIN32_PROXY_REGKEY "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /* For shfolder.dll */ typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR); @@ -57,9 +56,6 @@ static HINSTANCE libpurpledll_hInstance = 0; -static HANDLE proxy_change_event = NULL; -static HKEY proxy_regkey = NULL; - /* * PUBLIC CODE */ @@ -431,86 +427,93 @@ return result; } -static void wpurple_refresh_proxy(void) { - gboolean set_proxy = FALSE; - DWORD enabled = 0; +/* the winapi headers don't yet have winhttp.h, so we use the struct from msdn directly */ +typedef struct { + BOOL fAutoDetect; + LPWSTR lpszAutoConfigUrl; + LPWSTR lpszProxy; + LPWSTR lpszProxyBypass; +} WINHTTP_CURRENT_USER_IE_PROXY_CONFIG; - wpurple_read_reg_dword(HKEY_CURRENT_USER, WIN32_PROXY_REGKEY, - "ProxyEnable", &enabled); - - if (enabled & 1) { - char *c = NULL; - char *tmp = wpurple_read_reg_string(HKEY_CURRENT_USER, WIN32_PROXY_REGKEY, - "ProxyServer"); +typedef BOOL (CALLBACK* LPFNWINHTTPGETIEPROXYCONFIG)(/*IN OUT*/ WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* pProxyConfig); - /* There are proxy settings for several protocols */ - if (tmp && (c = g_strstr_len(tmp, strlen(tmp), "http="))) { - char *d; - c += strlen("http="); - d = strchr(c, ';'); - if (d) - *d = '\0'; - /* c now points the proxy server (and port) */ +gboolean wpurple_check_for_proxy_changes(void) { + static gboolean loaded = FALSE; + static LPFNWINHTTPGETIEPROXYCONFIG MyWinHttpGetIEProxyConfig = NULL; - /* There is only a global proxy */ - } else if (tmp && strlen(tmp) > 0 && !strchr(tmp, ';')) { - c = tmp; + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ie_proxy_config; + char *tmp = NULL, *c = NULL; + gboolean changed = FALSE; + + if (!loaded) { + loaded = TRUE; + + if (getenv("HTTP_PROXY") || getenv("http_proxy") || getenv("HTTPPROXY")) { + purple_debug_info("wpurple", "HTTP_PROXY env. var already set. Ignoring win32 Internet Settings.\n"); + return FALSE; } - if (c) { + MyWinHttpGetIEProxyConfig = (LPFNWINHTTPGETIEPROXYCONFIG) + wpurple_find_and_loadproc("winhttp.dll", "WinHttpGetIEProxyConfigForCurrentUser"); + if (!MyWinHttpGetIEProxyConfig) + purple_debug_info("wpurple", "Unable to read Windows Proxy Settings.\n"); + } + + if (!MyWinHttpGetIEProxyConfig) + return FALSE; + + ZeroMemory(&ie_proxy_config, sizeof(ie_proxy_config)); + if (!MyWinHttpGetIEProxyConfig(&ie_proxy_config)) { + purple_debug_error("wpurple", "Error reading Windows Proxy Settings(%u).\n", GetLastError()); + return FALSE; + } + + /* We can't do much if it is autodetect*/ + if (ie_proxy_config.fAutoDetect) + purple_debug_error("wpurple", "Windows Proxy Settings set to autodetect (not supported).\n"); + else if (ie_proxy_config.lpszProxy) { + tmp = g_utf16_to_utf8(ie_proxy_config.lpszProxy, -1, + NULL, NULL, NULL); + /* We can't do anything about the bypass list, as we don't have the url */ + } else + purple_debug_info("wpurple", "No Windows Proxy Set.\n"); + + if (ie_proxy_config.lpszAutoConfigUrl) + GlobalFree(ie_proxy_config.lpszAutoConfigUrl); + if (ie_proxy_config.lpszProxy) + GlobalFree(ie_proxy_config.lpszProxy); + if (ie_proxy_config.lpszProxyBypass) + GlobalFree(ie_proxy_config.lpszProxyBypass); + + /* There are proxy settings for several protocols */ + if (tmp && (c = g_strstr_len(tmp, strlen(tmp), "http="))) { + char *d; + c += strlen("http="); + d = strchr(c, ';'); + if (d) + *d = '\0'; + /* c now points the proxy server (and port) */ + /* There is only a global proxy */ + } else if (tmp && strlen(tmp) > 0 && !strchr(tmp, ';')) { + c = tmp; + } + + if (c && *c) { + const char *current = g_getenv("HTTP_PROXY"); + if (!current || strcmp(current, c)) { purple_debug_info("wpurple", "Setting HTTP Proxy: 'http://%s'\n", c); g_setenv("HTTP_PROXY", c, TRUE); - set_proxy = TRUE; + changed = TRUE; } - g_free(tmp); } - /* If there previously was a proxy set and there isn't one now, clear it */ - if (getenv("HTTP_PROXY") && !set_proxy) { + else if (getenv("HTTP_PROXY")) { purple_debug_info("wpurple", "Clearing HTTP Proxy\n"); g_unsetenv("HTTP_PROXY"); - } -} - -static void watch_for_proxy_changes(void) { - LONG rv; - DWORD filter = REG_NOTIFY_CHANGE_NAME | - REG_NOTIFY_CHANGE_LAST_SET; - - if (!proxy_regkey && - !(proxy_regkey = _reg_open_key(HKEY_CURRENT_USER, - WIN32_PROXY_REGKEY, KEY_NOTIFY))) { - return; - } - - if (!(proxy_change_event = CreateEvent(NULL, TRUE, FALSE, NULL))) { - char *errmsg = g_win32_error_message(GetLastError()); - purple_debug_error("wpurple", "Unable to watch for proxy changes: %s\n", errmsg); - g_free(errmsg); - return; + changed = TRUE; } - rv = RegNotifyChangeKeyValue(proxy_regkey, TRUE, filter, proxy_change_event, TRUE); - if (rv != ERROR_SUCCESS) { - char *errmsg = g_win32_error_message(rv); - purple_debug_error("wpurple", "Unable to watch for proxy changes: %s\n", errmsg); - g_free(errmsg); - CloseHandle(proxy_change_event); - proxy_change_event = NULL; - } - -} - -gboolean wpurple_check_for_proxy_changes(void) { - gboolean changed = FALSE; - - if (proxy_change_event && WaitForSingleObject(proxy_change_event, 0) == WAIT_OBJECT_0) { - CloseHandle(proxy_change_event); - proxy_change_event = NULL; - changed = TRUE; - wpurple_refresh_proxy(); - watch_for_proxy_changes(); - } + g_free(tmp); return changed; } @@ -555,15 +558,6 @@ if (!g_thread_supported()) g_thread_init(NULL); - /* If the proxy server environment variables are already set, - * we shouldn't override them */ - if (!getenv("HTTP_PROXY") && !getenv("http_proxy") && !getenv("HTTPPROXY")) { - wpurple_refresh_proxy(); - watch_for_proxy_changes(); - } else { - purple_debug_info("wpurple", "HTTP_PROXY env. var already set. Ignoring win32 Internet Settings.\n"); - } - purple_debug_info("wpurple", "wpurple_init end\n"); } @@ -578,11 +572,6 @@ g_free(app_data_dir); app_data_dir = NULL; - if (proxy_regkey) { - RegCloseKey(proxy_regkey); - proxy_regkey = NULL; - } - libpurpledll_hInstance = NULL; } diff -r 485a0bffe4f5 -r 707cd521188a pidgin/gtkblist.c --- a/pidgin/gtkblist.c Fri Sep 21 02:11:29 2007 +0000 +++ b/pidgin/gtkblist.c Fri Sep 21 13:27:41 2007 +0000 @@ -3105,7 +3105,7 @@ { 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) +#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 }, @@ -4820,7 +4820,7 @@ "visible", EMBLEM_VISIBLE_COLUMN, NULL); rend = gtk_cell_renderer_pixbuf_new(); - gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_pack_start(column, rend, FALSE); gtk_tree_view_column_set_attributes(column, rend, "pixbuf", PROTOCOL_ICON_COLUMN, "visible", PROTOCOL_ICON_VISIBLE_COLUMN, @@ -5265,7 +5265,7 @@ group = (PurpleGroup*)gnode; textcolor = gtkblist->treeview->style->fg[GTK_STATE_ACTIVE]; - + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)), NULL, &iter)) { gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &selected_node, -1); @@ -6319,9 +6319,13 @@ gtkblist->headline_callback = callback; gtkblist->headline_data = user_data; gtkblist->headline_destroy = destroy; - if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window)) - pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE); - gtk_widget_show_all(gtkblist->headline_hbox); + if (text != NULL || pixbuf != NULL) { + if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window)) + pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE); + gtk_widget_show_all(gtkblist->headline_hbox); + } else { + gtk_widget_hide(gtkblist->headline_hbox); + } } static PurpleBlistUiOps blist_ui_ops = diff -r 485a0bffe4f5 -r 707cd521188a pidgin/gtkdialogs.c --- a/pidgin/gtkdialogs.c Fri Sep 21 02:11:29 2007 +0000 +++ b/pidgin/gtkdialogs.c Fri Sep 21 13:27:41 2007 +0000 @@ -286,6 +286,7 @@ about = NULL; } +#if 0 /* This function puts the version number onto the pixmap we use in the 'about' * screen in Pidgin. */ static void @@ -323,6 +324,7 @@ width, height); g_object_unref(G_OBJECT(pixmap)); } +#endif void pidgin_dialogs_about() { @@ -386,6 +388,9 @@ str = g_string_sized_new(4096); g_string_append_printf(str, + "
%s %s


", PIDGIN_NAME, VERSION); + + g_string_append_printf(str, _("%s is a graphical modular messaging client based on " "libpurple which is capable of connecting to " "AIM, MSN, Yahoo!, XMPP, ICQ, IRC, SILC, SIP/SIMPLE, " diff -r 485a0bffe4f5 -r 707cd521188a pidgin/gtknotify.c --- a/pidgin/gtknotify.c Fri Sep 21 02:11:29 2007 +0000 +++ b/pidgin/gtknotify.c Fri Sep 21 13:27:41 2007 +0000 @@ -413,7 +413,7 @@ * count > 0 mean non-detailed. */ static void * -pidgin_notify_add_mail(GtkTreeStore *treemodel, PurpleAccount *account, char *notification, const char *url, int count) +pidgin_notify_add_mail(GtkTreeStore *treemodel, PurpleAccount *account, char *notification, const char *url, int count, gboolean clear) { PidginNotifyMailData *data = NULL; GtkTreeIter iter; @@ -422,20 +422,30 @@ icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); - if (count > 0) { + if (count > 0 || clear) { /* Allow only one non-detailed email notification for each account */ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(treemodel), &iter)) { + gboolean advanced; do { + advanced = FALSE; gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter, PIDGIN_MAIL_DATA, &data, -1); - if (data->account == account && data->count > 0) { - new_n = FALSE; - g_free(data->url); - data->url = NULL; - mail_dialog->total_count -= data->count; - break; + if (data->account == account) { + if (clear) { + advanced = gtk_tree_store_remove(treemodel, &iter); + purple_notify_close(PURPLE_NOTIFY_EMAILS, data); + /* We're completely done if we've processed all entries */ + if (!advanced) + return NULL; + } else if (data->count > 0) { + new_n = FALSE; + g_free(data->url); + data->url = NULL; + mail_dialog->total_count -= data->count; + break; + } } - } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(treemodel), &iter)); + } while (advanced || gtk_tree_model_iter_next(GTK_TREE_MODEL(treemodel), &iter)); } } @@ -472,9 +482,13 @@ PurpleAccount *account; PidginNotifyMailData *data = NULL; + /* Don't bother updating if there aren't new emails and we don't have any displayed currently */ + if (count == 0 && mail_dialog == NULL) + return NULL; + account = purple_connection_get_account(gc); dialog = pidgin_get_mail_dialog(); /* This creates mail_dialog if necessary */ - + mail_dialog->total_count += count; if (detailed) { while (count--) { @@ -512,31 +526,46 @@ g_free(from_text); g_free(subject_text); - data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0); + data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE); g_free(notification); if (urls != NULL) urls++; } } else { - notification = g_strdup_printf(ngettext("%s has %d new message.", - "%s has %d new messages.", - (int)count), - *tos, (int)count); - data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count); - g_free(notification); + if (count > 0) { + notification = g_strdup_printf(ngettext("%s has %d new message.", + "%s has %d new messages.", + (int)count), + *tos, (int)count); + data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE); + g_free(notification); + } else { + GtkTreeIter iter; + + /* Clear out all mails for the account */ + pidgin_notify_add_mail(mail_dialog->treemodel, account, NULL, NULL, 0, TRUE); + + if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) { + /* There is no API to clear the headline specifically */ + /* This will trigger reset_mail_dialog() */ + pidgin_blist_set_headline(NULL, NULL, NULL, NULL, NULL); + } + + return NULL; + } } if (!GTK_WIDGET_VISIBLE(dialog)) { GdkPixbuf *pixbuf = gtk_widget_render_icon(dialog, PIDGIN_STOCK_DIALOG_MAIL, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), NULL); - char *label_text = g_strdup_printf(ngettext("You have %d new e-mail.", - "You have %d new e-mails.", + char *label_text = g_strdup_printf(ngettext("%d new e-mail.", + "%d new e-mails.", mail_dialog->total_count), mail_dialog->total_count); mail_dialog->in_use = TRUE; /* So that _set_headline doesn't accidentally remove the notifications when replacing an old notification. */ - pidgin_blist_set_headline(label_text, + pidgin_blist_set_headline(label_text, pixbuf, G_CALLBACK(gtk_widget_show_all), dialog, (GDestroyNotify)reset_mail_dialog); mail_dialog->in_use = FALSE; diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/protocols/22/myspace.png Binary file pidgin/pixmaps/protocols/22/myspace.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/protocols/22/scalable/myspace.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/protocols/22/scalable/myspace.svg Fri Sep 21 13:27:41 2007 +0000 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/available.png Binary file pidgin/pixmaps/status/16/available.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/away.png Binary file pidgin/pixmaps/status/16/away.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/busy.png Binary file pidgin/pixmaps/status/16/busy.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/extended-away.png Binary file pidgin/pixmaps/status/16/extended-away.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/offline.png Binary file pidgin/pixmaps/status/16/offline.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/rtl/extended-away.png Binary file pidgin/pixmaps/status/16/rtl/extended-away.png has changed diff -r 485a0bffe4f5 -r 707cd521188a pidgin/pixmaps/status/16/scalable/available.svg --- a/pidgin/pixmaps/status/16/scalable/available.svg Fri Sep 21 02:11:29 2007 +0000 +++ b/pidgin/pixmaps/status/16/scalable/available.svg Fri Sep 21 13:27:41 2007 +0000 @@ -13,13 +13,15 @@ height="16" id="svg2" sodipodi:version="0.32" - inkscape:version="0.44.1" + inkscape:version="0.45" version="1.0" inkscape:export-filename="/home/hbons/GUI/Tango/Gaim Refresh/status/16/available.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docbase="/home/hbons/Desktop/experiment/status/16/scalable" - sodipodi:docname="available.svg"> + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="available.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-y="25" /> @@ -263,16 +265,6 @@ inkscape:groupmode="layer" id="layer1"> - + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="away.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> - + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="busy.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-x="3" + inkscape:window-y="25" /> @@ -210,16 +212,6 @@ inkscape:groupmode="layer" id="layer1"> - + inkscape:export-ydpi="90" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22" /> @@ -79,27 +81,17 @@ inkscape:label="Layer 1" inkscape:groupmode="layer"> - + sodipodi:nodetypes="ccccccc" + transform="matrix(-1.708738,0,0,1.647118,-1.878642,-0.867731)" /> + sodipodi:nodetypes="cccccc" + transform="matrix(-1.398059,0,0,1.342047,-8.253506e-2,0.574281)" /> + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="offline.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-x="3" + inkscape:window-y="25" /> @@ -186,16 +188,6 @@ inkscape:groupmode="layer" id="layer1"> -