Mercurial > pidgin.yaz
comparison src/protocols/gg/gg.c @ 11397:d530188f04b8
[gaim-migrate @ 13629]
warning: ISO C90 forbids mixed declarations and code
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 31 Aug 2005 21:18:27 +0000 |
parents | 54934c165625 |
children | bc374facaeb2 |
comparison
equal
deleted
inserted
replaced
11396:be776f9b1818 | 11397:d530188f04b8 |
---|---|
530 | 530 |
531 users_tbl = g_strsplit(buddylist, "\r\n", 200); | 531 users_tbl = g_strsplit(buddylist, "\r\n", 200); |
532 | 532 |
533 for (i = 0; users_tbl[i] != NULL; i++) { | 533 for (i = 0; users_tbl[i] != NULL; i++) { |
534 gchar **data_tbl; | 534 gchar **data_tbl; |
535 gchar *name, *show; | 535 gchar *name, *show, *g; |
536 | 536 |
537 if (strlen(users_tbl[i]) == 0) | 537 if (strlen(users_tbl[i]) == 0) |
538 continue; | 538 continue; |
539 | 539 |
540 data_tbl = g_strsplit(users_tbl[i], ";", 8); | 540 data_tbl = g_strsplit(users_tbl[i], ";", 8); |
548 g_free(show); | 548 g_free(show); |
549 g_strfreev(data_tbl); | 549 g_strfreev(data_tbl); |
550 continue; | 550 continue; |
551 } | 551 } |
552 | 552 |
553 gchar *g = g_strdup("Gadu-Gadu"); | 553 g = g_strdup("Gadu-Gadu"); |
554 | 554 |
555 if (strlen(data_tbl[5])) { | 555 if (strlen(data_tbl[5])) { |
556 /* Hard limit to at most 50 groups */ | 556 /* Hard limit to at most 50 groups */ |
557 gchar **group_tbl = g_strsplit(data_tbl[5], ",", 50); | 557 gchar **group_tbl = g_strsplit(data_tbl[5], ",", 50); |
558 if (strlen(group_tbl[0]) > 0) { | 558 if (strlen(group_tbl[0]) > 0) { |
991 for (cnode = gnode->child; cnode != NULL; cnode = cnode->next) { | 991 for (cnode = gnode->child; cnode != NULL; cnode = cnode->next) { |
992 if (!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | 992 if (!GAIM_BLIST_NODE_IS_CONTACT(cnode)) |
993 continue; | 993 continue; |
994 | 994 |
995 for (bnode = cnode->child; bnode != NULL; bnode = bnode->next) { | 995 for (bnode = cnode->child; bnode != NULL; bnode = bnode->next) { |
996 gchar *newdata, *name, *show, *gname; | |
997 | |
996 if (!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | 998 if (!GAIM_BLIST_NODE_IS_BUDDY(bnode)) |
997 continue; | 999 continue; |
998 | 1000 |
999 buddy = (GaimBuddy *)bnode; | 1001 buddy = (GaimBuddy *)bnode; |
1000 if (buddy->account != account) | 1002 if (buddy->account != account) |
1001 continue; | 1003 continue; |
1002 | 1004 |
1003 gchar *newdata; | |
1004 /* GG Number */ | 1005 /* GG Number */ |
1005 gchar *name = buddy->name; | 1006 name = buddy->name; |
1006 /* GG Pseudo */ | 1007 /* GG Pseudo */ |
1007 gchar *show = buddy->alias ? buddy->alias : buddy->name; | 1008 show = buddy->alias ? buddy->alias : buddy->name; |
1008 /* Group Name */ | 1009 /* Group Name */ |
1009 gchar *gname = group->name; | 1010 gname = group->name; |
1010 | 1011 |
1011 newdata = g_strdup_printf("%s;%s;%s;%s;%s;%s;%s;%s%s\r\n", | 1012 newdata = g_strdup_printf("%s;%s;%s;%s;%s;%s;%s;%s%s\r\n", |
1012 show, show, show, show, "", gname, name, "", ""); | 1013 show, show, show, show, "", gname, name, "", ""); |
1013 | 1014 |
1014 ptr = buddylist; | 1015 ptr = buddylist; |
1856 static void ggp_set_status(GaimAccount *account, GaimStatus *status) | 1857 static void ggp_set_status(GaimAccount *account, GaimStatus *status) |
1857 { | 1858 { |
1858 GaimStatusPrimitive prim; | 1859 GaimStatusPrimitive prim; |
1859 GaimConnection *gc; | 1860 GaimConnection *gc; |
1860 GGPInfo *info; | 1861 GGPInfo *info; |
1861 const char *status_id; | 1862 const char *status_id, *msg; |
1862 int new_status, new_status_descr; | 1863 int new_status, new_status_descr; |
1863 | 1864 |
1864 prim = gaim_status_type_get_primitive(gaim_status_get_type(status)); | 1865 prim = gaim_status_type_get_primitive(gaim_status_get_type(status)); |
1865 | 1866 |
1866 if (!gaim_status_is_active(status)) | 1867 if (!gaim_status_is_active(status)) |
1896 new_status = GG_STATUS_AVAIL; | 1897 new_status = GG_STATUS_AVAIL; |
1897 new_status_descr = GG_STATUS_AVAIL_DESCR; | 1898 new_status_descr = GG_STATUS_AVAIL_DESCR; |
1898 gaim_debug_info("gg", "ggp_set_status: uknown status requested (status_id=%s)\n", status_id); | 1899 gaim_debug_info("gg", "ggp_set_status: uknown status requested (status_id=%s)\n", status_id); |
1899 } | 1900 } |
1900 | 1901 |
1901 const char *msg = gaim_status_get_attr_string(status, "message"); | 1902 msg = gaim_status_get_attr_string(status, "message"); |
1902 | 1903 |
1903 if (msg == NULL) { | 1904 if (msg == NULL) { |
1904 gaim_debug_info("gg", "ggp_set_status: msg == NULL\n"); | 1905 gaim_debug_info("gg", "ggp_set_status: msg == NULL\n"); |
1905 gg_change_status(info->session, new_status); | 1906 gg_change_status(info->session, new_status); |
1906 } else { | 1907 } else { |