Mercurial > pidgin
comparison src/protocols/trepia/trepia.c @ 7382:e6e194f9d44c
[gaim-migrate @ 7977]
i don't know if this makes trepia work (i don't really care) but it does let it compile
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 30 Oct 2003 16:02:28 +0000 |
parents | bf630f7dfdcd |
children | 08c9d0dcf906 |
comparison
equal
deleted
inserted
replaced
7381:75733c68479a | 7382:e6e194f9d44c |
---|---|
123 #endif | 123 #endif |
124 | 124 |
125 static void | 125 static void |
126 __clear_user_list(TrepiaSession *session) | 126 __clear_user_list(TrepiaSession *session) |
127 { | 127 { |
128 GaimBlistNode *gnode, *bnode; | 128 GaimBlistNode *gnode, *cnode, *bnode; |
129 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { | 129 for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { |
130 bnode = gnode->child; | 130 cnode = gnode->child; |
131 while(bnode) { | 131 |
132 struct buddy *buddy = (struct buddy *)bnode; | 132 while(cnode) { |
133 if(GAIM_BLIST_NODE_IS_BUDDY(bnode) && | 133 if(GAIM_BLIST_NODE_IS_CONTACT(cnode)) { |
134 buddy->account == session->gc->account) { | 134 bnode = cnode->child; |
135 bnode = bnode->next; | 135 cnode = cnode->next; |
136 gaim_blist_remove_buddy(buddy); | 136 while(bnode) { |
137 GaimBuddy *buddy = (GaimBuddy *)bnode; | |
138 if(GAIM_BLIST_NODE_IS_BUDDY(bnode) && | |
139 buddy->account == session->gc->account) { | |
140 bnode = bnode->next; | |
141 gaim_blist_remove_buddy(buddy); | |
142 } else { | |
143 bnode = bnode->next; | |
144 } | |
145 } | |
137 } else { | 146 } else { |
138 bnode = bnode->next; | 147 cnode = cnode->next; |
139 } | 148 } |
140 } | 149 } |
141 } | 150 } |
142 } | 151 } |
143 | 152 |
341 /************************************************************************** | 350 /************************************************************************** |
342 * Protocol Plugin ops | 351 * Protocol Plugin ops |
343 **************************************************************************/ | 352 **************************************************************************/ |
344 | 353 |
345 static const char * | 354 static const char * |
346 trepia_list_icon(GaimAccount *a, struct buddy *b) | 355 trepia_list_icon(GaimAccount *a, GaimBuddy *b) |
347 { | 356 { |
348 return "trepia"; | 357 return "trepia"; |
349 } | 358 } |
350 | 359 |
351 static void | 360 static void |
352 trepia_list_emblems(struct buddy *b, char **se, char **sw, | 361 trepia_list_emblems(GaimBuddy *b, char **se, char **sw, |
353 char **nw, char **ne) | 362 char **nw, char **ne) |
354 { | 363 { |
355 TrepiaProfile *profile = (TrepiaProfile *)b->proto_data; | 364 TrepiaProfile *profile = (TrepiaProfile *)b->proto_data; |
356 | 365 |
357 if (trepia_profile_get_sex(profile) == 'M') | 366 if (trepia_profile_get_sex(profile) == 'M') |
359 else if (trepia_profile_get_sex(profile)) | 368 else if (trepia_profile_get_sex(profile)) |
360 *sw = "female"; | 369 *sw = "female"; |
361 } | 370 } |
362 | 371 |
363 static char * | 372 static char * |
364 trepia_status_text(struct buddy *b) | 373 trepia_status_text(GaimBuddy *b) |
365 { | 374 { |
366 TrepiaProfile *profile = (TrepiaProfile *)b->proto_data; | 375 TrepiaProfile *profile = (TrepiaProfile *)b->proto_data; |
367 const char *value; | 376 const char *value; |
368 char *text = NULL; | 377 char *text = NULL; |
369 | 378 |
372 | 381 |
373 return text; | 382 return text; |
374 } | 383 } |
375 | 384 |
376 static char * | 385 static char * |
377 trepia_tooltip_text(struct buddy *b) | 386 trepia_tooltip_text(GaimBuddy *b) |
378 { | 387 { |
379 TrepiaProfile *profile = (TrepiaProfile *)b->proto_data; | 388 TrepiaProfile *profile = (TrepiaProfile *)b->proto_data; |
380 const char *value; | 389 const char *value; |
381 const char *first_name, *last_name; | 390 const char *first_name, *last_name; |
382 int int_value; | 391 int int_value; |
488 | 497 |
489 static void | 498 static void |
490 trepia_visit_homepage(GaimConnection *gc, const char *who) | 499 trepia_visit_homepage(GaimConnection *gc, const char *who) |
491 { | 500 { |
492 TrepiaProfile *profile; | 501 TrepiaProfile *profile; |
493 struct buddy *b; | 502 GaimBuddy *b; |
494 const char *value; | 503 const char *value; |
495 | 504 |
496 b = gaim_find_buddy(gaim_connection_get_account(gc), who); | 505 b = gaim_find_buddy(gaim_connection_get_account(gc), who); |
497 profile = b->proto_data; | 506 profile = b->proto_data; |
498 | 507 |
502 | 511 |
503 static GList * | 512 static GList * |
504 trepia_buddy_menu(GaimConnection *gc, const char *who) | 513 trepia_buddy_menu(GaimConnection *gc, const char *who) |
505 { | 514 { |
506 TrepiaProfile *profile; | 515 TrepiaProfile *profile; |
507 struct buddy *b; | 516 GaimBuddy *b; |
508 const char *value = NULL; | 517 const char *value = NULL; |
509 GList *m = NULL; | 518 GList *m = NULL; |
510 struct proto_buddy_menu *pbm; | 519 struct proto_buddy_menu *pbm; |
511 | 520 |
512 b = gaim_find_buddy(gaim_connection_get_account(gc), who); | 521 b = gaim_find_buddy(gaim_connection_get_account(gc), who); |
654 GaimAccount *account; | 663 GaimAccount *account; |
655 TrepiaMessageType type = 0; | 664 TrepiaMessageType type = 0; |
656 TrepiaProfile *profile = NULL; | 665 TrepiaProfile *profile = NULL; |
657 int ret; | 666 int ret; |
658 char *buffer; | 667 char *buffer; |
659 struct buddy *b; | 668 GaimBuddy *b; |
660 int id = 0; | 669 int id = 0; |
661 const char *value; | 670 const char *value; |
662 char *username; | 671 char *username; |
663 int *int_p; | 672 int *int_p; |
664 GMainContext *ctx; | 673 GMainContext *ctx; |
856 } | 865 } |
857 | 866 |
858 b = gaim_find_buddy(account, username); | 867 b = gaim_find_buddy(account, username); |
859 | 868 |
860 if (b == NULL) { | 869 if (b == NULL) { |
861 struct group *g; | 870 GaimGroup *g; |
862 | 871 |
863 g = gaim_find_group(_("Local Users")); | 872 g = gaim_find_group(_("Local Users")); |
864 | 873 |
865 if (g == NULL) { | 874 if (g == NULL) { |
866 g = gaim_group_new(_("Local Users")); | 875 g = gaim_group_new(_("Local Users")); |
867 gaim_blist_add_group(g, NULL); | 876 gaim_blist_add_group(g, NULL); |
868 } | 877 } |
869 | 878 |
870 b = gaim_buddy_new(account, username, NULL); | 879 b = gaim_buddy_new(account, username, NULL); |
871 | 880 |
872 gaim_blist_add_buddy(b, g, NULL); | 881 gaim_blist_add_buddy(b, NULL, g, NULL); |
873 } | 882 } |
874 | 883 |
875 profile->buddy = b; | 884 profile->buddy = b; |
876 | 885 |
877 b->proto_data = profile; | 886 b->proto_data = profile; |
892 char *icon; | 901 char *icon; |
893 int icon_len; | 902 int icon_len; |
894 | 903 |
895 gaim_base64_decode(value, &icon, &icon_len); | 904 gaim_base64_decode(value, &icon, &icon_len); |
896 | 905 |
897 set_icon_data(session->gc, username, icon, icon_len); | 906 gaim_buddy_icons_set_for_user(session->gc->account, |
907 username, icon, icon_len); | |
898 | 908 |
899 g_free(icon); | 909 g_free(icon); |
900 | 910 |
901 serv_got_update(session->gc, username, 1, 0, 0, 0, 0); | 911 serv_got_update(session->gc, username, 1, 0, 0, 0, 0); |
902 } | 912 } |
1135 trepia_send_im(GaimConnection *gc, const char *who, const char *message, | 1145 trepia_send_im(GaimConnection *gc, const char *who, const char *message, |
1136 GaimConvImFlags flags) | 1146 GaimConvImFlags flags) |
1137 { | 1147 { |
1138 TrepiaSession *session = gc->proto_data; | 1148 TrepiaSession *session = gc->proto_data; |
1139 TrepiaProfile *profile; | 1149 TrepiaProfile *profile; |
1140 struct buddy *b; | 1150 GaimBuddy *b; |
1141 char *escaped_msg; | 1151 char *escaped_msg; |
1142 char *buffer; | 1152 char *buffer; |
1143 | 1153 |
1144 b = gaim_find_buddy(gaim_connection_get_account(gc), who); | 1154 b = gaim_find_buddy(gaim_connection_get_account(gc), who); |
1145 | 1155 |
1180 trepia_rem_buddy(GaimConnection *gc, const char *who, const char *group) | 1190 trepia_rem_buddy(GaimConnection *gc, const char *who, const char *group) |
1181 { | 1191 { |
1182 } | 1192 } |
1183 | 1193 |
1184 static void | 1194 static void |
1185 trepia_buddy_free(struct buddy *b) | 1195 trepia_buddy_free(GaimBuddy *b) |
1186 { | 1196 { |
1187 if (b->proto_data != NULL) { | 1197 if (b->proto_data != NULL) { |
1188 trepia_profile_destroy(b->proto_data); | 1198 trepia_profile_destroy(b->proto_data); |
1189 | 1199 |
1190 b->proto_data = NULL; | 1200 b->proto_data = NULL; |