Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/oscar.c @ 27950:fb593c327870
propagate from branch 'im.pidgin.pidgin' (head e155acab29d005538351633111052f094e5f5f98)
to branch 'im.pidgin.pidgin.yaz' (head 9a2679f1f093d6f68ab515aa5278606fb451449a)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 12 Jun 2009 05:27:34 +0000 |
parents | c2ac87c5a035 28b5fcfb7444 |
children | 462a509fb2ad |
comparison
equal
deleted
inserted
replaced
27949:a4a2090fd976 | 27950:fb593c327870 |
---|---|
3597 havenewmail = va_arg(ap, int); | 3597 havenewmail = va_arg(ap, int); |
3598 alertitle = va_arg(ap, char *); | 3598 alertitle = va_arg(ap, char *); |
3599 alerturl = va_arg(ap, char *); | 3599 alerturl = va_arg(ap, char *); |
3600 va_end(ap); | 3600 va_end(ap); |
3601 | 3601 |
3602 if (account != NULL && emailinfo != NULL && emailinfo->unread && havenewmail) { | 3602 if (account != NULL && emailinfo != NULL && purple_account_get_check_mail(account) && |
3603 emailinfo->unread && havenewmail) { | |
3603 gchar *to = g_strdup_printf("%s%s%s", | 3604 gchar *to = g_strdup_printf("%s%s%s", |
3604 purple_account_get_username(account), | 3605 purple_account_get_username(account), |
3605 emailinfo->domain ? "@" : "", | 3606 emailinfo->domain ? "@" : "", |
3606 emailinfo->domain ? emailinfo->domain : ""); | 3607 emailinfo->domain ? emailinfo->domain : ""); |
3607 const char *tos[2] = { to }; | 3608 const char *tos[2] = { to }; |
6567 | 6568 |
6568 static void oscar_show_awaitingauth(PurplePluginAction *action) | 6569 static void oscar_show_awaitingauth(PurplePluginAction *action) |
6569 { | 6570 { |
6570 PurpleConnection *gc = (PurpleConnection *) action->context; | 6571 PurpleConnection *gc = (PurpleConnection *) action->context; |
6571 OscarData *od = purple_connection_get_protocol_data(gc); | 6572 OscarData *od = purple_connection_get_protocol_data(gc); |
6572 gchar *nombre, *text, *tmp; | 6573 gchar *text, *tmp; |
6573 PurpleBlistNode *gnode, *cnode, *bnode; | 6574 GSList *buddies; |
6574 PurpleAccount *account; | 6575 PurpleAccount *account; |
6575 int num=0; | 6576 int num=0; |
6576 | 6577 |
6577 text = g_strdup(""); | 6578 text = g_strdup(""); |
6578 account = purple_connection_get_account(gc); | 6579 account = purple_connection_get_account(gc); |
6579 | 6580 |
6580 for (gnode = purple_blist_get_root(); gnode; | 6581 buddies = purple_find_buddies(account, NULL); |
6581 gnode = purple_blist_node_get_sibling_next(gnode)) { | 6582 while (buddies) { |
6582 PurpleGroup *group = (PurpleGroup *)gnode; | 6583 PurpleBuddy *buddy; |
6583 const char *gname; | 6584 const gchar *bname, *gname; |
6584 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode)) | 6585 |
6585 continue; | 6586 buddy = buddies->data; |
6586 gname = purple_group_get_name(group); | 6587 bname = purple_buddy_get_name(buddy); |
6587 for (cnode = purple_blist_node_get_first_child(gnode); | 6588 gname = purple_group_get_name(purple_buddy_get_group(buddy)); |
6588 cnode; | 6589 if (aim_ssi_waitingforauth(od->ssi.local, gname, bname)) { |
6589 cnode = purple_blist_node_get_sibling_next(cnode)) { | 6590 const gchar *alias = purple_buddy_get_alias_only(buddy); |
6590 if(!PURPLE_BLIST_NODE_IS_CONTACT(cnode)) | 6591 if (alias) |
6591 continue; | 6592 tmp = g_strdup_printf("%s %s (%s)<br>", text, bname, alias); |
6592 for (bnode = purple_blist_node_get_first_child(cnode); | 6593 else |
6593 bnode; | 6594 tmp = g_strdup_printf("%s %s<br>", text, bname); |
6594 bnode = purple_blist_node_get_sibling_next(bnode)) { | 6595 g_free(text); |
6595 PurpleBuddy *buddy = (PurpleBuddy *)bnode; | 6596 text = tmp; |
6596 const char *bname; | 6597 |
6597 if(!PURPLE_BLIST_NODE_IS_BUDDY(bnode)) | 6598 num++; |
6598 continue; | 6599 } |
6599 bname = purple_buddy_get_name(buddy); | 6600 |
6600 if (purple_buddy_get_account(buddy) == account && aim_ssi_waitingforauth(od->ssi.local, gname, bname)) { | 6601 buddies = g_slist_delete_link(buddies, buddies); |
6601 if (purple_buddy_get_alias_only(buddy)) | |
6602 nombre = g_strdup_printf(" %s (%s)", bname, purple_buddy_get_alias_only(buddy)); | |
6603 else | |
6604 nombre = g_strdup_printf(" %s", bname); | |
6605 tmp = g_strdup_printf("%s%s<br>", text, nombre); | |
6606 g_free(text); | |
6607 text = tmp; | |
6608 g_free(nombre); | |
6609 num++; | |
6610 } | |
6611 } | |
6612 } | |
6613 } | 6602 } |
6614 | 6603 |
6615 if (!num) { | 6604 if (!num) { |
6616 g_free(text); | 6605 g_free(text); |
6617 text = g_strdup(_("<i>you are not waiting for authorization</i>")); | 6606 text = g_strdup(_("<i>you are not waiting for authorization</i>")); |
7060 init = TRUE; | 7049 init = TRUE; |
7061 | 7050 |
7062 /* Preferences */ | 7051 /* Preferences */ |
7063 purple_prefs_add_none("/plugins/prpl/oscar"); | 7052 purple_prefs_add_none("/plugins/prpl/oscar"); |
7064 purple_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE); | 7053 purple_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE); |
7054 | |
7055 /* | |
7056 * These two preferences will normally not be changed. UIs can optionally | |
7057 * use them to override these two version fields which are sent to the | |
7058 * server when logging in. AOL requested this change to allow clients to | |
7059 * use custom values. | |
7060 */ | |
7061 purple_prefs_add_string("/plugins/prpl/oscar/clientstring", NULL); | |
7062 purple_prefs_add_int("/plugins/prpl/oscar/distid", -1); | |
7063 | |
7065 purple_prefs_remove("/plugins/prpl/oscar/show_idle"); | 7064 purple_prefs_remove("/plugins/prpl/oscar/show_idle"); |
7066 purple_prefs_remove("/plugins/prpl/oscar/always_use_rv_proxy"); | 7065 purple_prefs_remove("/plugins/prpl/oscar/always_use_rv_proxy"); |
7067 | 7066 |
7068 /* protocol handler */ | 7067 /* protocol handler */ |
7069 /* TODO: figure out a good instance to use here */ | 7068 /* TODO: figure out a good instance to use here */ |