comparison src/server.c @ 4687:283fb289c510

[gaim-migrate @ 4998] This is a new buddy list. Lots of things about it just Don't Work. I probably already know about those things, and you'd just be wasting my time in submitting a bug report about it. I decided that instead of getting it to all work perfectly before committing, that I'd get it in cvs, and slowly fix it with regular commits. That way, it's easier to keep track of things, and other developers can help. Plus, I'm getting pissed off at the buddy list and want it to die. It's kinda boring, and doing nothing but the buddy list for such a long time has just gotten me very bitter. After 0.60 is released later this week, Gaim will resume being fun. This week is going to be very stressful, though, I'm sure. Things you ought to know about this buddy list: - It crashes - It leaks - There's no way to edit the buddy list, or access offline buddies - Most of the menus and buttons and whatnot just plain ol' don't work. - Status icons are only implemented for AIM. That's mostly just because I'm lazy. As such, you may want to be wary of updating this. If you do decide to update this, you may want to learn "cvs update -D yesterday" as well :) All the art there is just placeholder art. You probably won't really have as many problems as it sounds like you will from reading this. This message is extra-negative to stress that I don't want to be bothered with complaints about something not working about it :). I'll repeat: If something doesn't work, I probably already know about it. If you want to actually help with something, I'd be delighted to have it. IM me. -s. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 10 Mar 2003 05:30:31 +0000
parents 42d53c416bb9
children c15e0699acae
comparison
equal deleted inserted replaced
4686:a1de8a9c99ba 4687:283fb289c510
37 #include "gaim.h" 37 #include "gaim.h"
38 38
39 #include "pixmaps/cancel.xpm" 39 #include "pixmaps/cancel.xpm"
40 #include "pixmaps/tb_search.xpm" 40 #include "pixmaps/tb_search.xpm"
41 41
42 #include "pounce.h"
43
42 void serv_login(struct gaim_account *account) 44 void serv_login(struct gaim_account *account)
43 { 45 {
44 struct prpl *p = find_prpl(account->protocol); 46 struct prpl *p = find_prpl(account->protocol);
45 47
46 if (account->gc != NULL || p == NULL) 48 if (account->gc != NULL || p == NULL)
349 b->account->gc->prpl->alias_buddy(b->account->gc, b->name, b->alias); 351 b->account->gc->prpl->alias_buddy(b->account->gc, b->name, b->alias);
350 } 352 }
351 } 353 }
352 354
353 void serv_got_alias(struct gaim_connection *gc, char *who, char *alias) { 355 void serv_got_alias(struct gaim_connection *gc, char *who, char *alias) {
354 struct buddy *b = find_buddy(gc->account, who); 356 struct buddy *b = gaim_find_buddy(gc->account, who);
355 if(!b) 357 if(!b)
356 return; 358 return;
357 359
360 if (b->server_alias)
361 g_free(b->server_alias);
362
358 if(alias) 363 if(alias)
359 g_snprintf(b->server_alias, sizeof(b->server_alias), "%s", alias); 364 b->server_alias = g_strdup(alias);
360 else 365 else
361 b->server_alias[0] = '\0'; 366 b->server_alias = NULL;
362 367
363 handle_buddy_rename(b, b->name); 368 //gaim_blist_rename_buddy(b, b->name);
364 } 369 }
365 370
366 /* 371 /*
367 * Move a buddy from one group to another on server. 372 * Move a buddy from one group to another on server.
368 * 373 *
654 * things we have to do for each. 659 * things we have to do for each.
655 */ 660 */
656 if (gc->away) { 661 if (gc->away) {
657 time_t t; 662 time_t t;
658 char *tmpmsg; 663 char *tmpmsg;
659 struct buddy *b = find_buddy(gc->account, name); 664 struct buddy *b = gaim_find_buddy(gc->account, name);
660 char *alias = b ? get_buddy_alias(b) : name; 665 char *alias = b ? gaim_get_buddy_alias(b) : name;
661 int row; 666 int row;
662 struct queued_away_response *qar; 667 struct queued_away_response *qar;
663 668
664 time(&t); 669 time(&t);
665 670
843 848
844 849
845 void serv_got_update(struct gaim_connection *gc, char *name, int loggedin, 850 void serv_got_update(struct gaim_connection *gc, char *name, int loggedin,
846 int evil, time_t signon, time_t idle, int type, guint caps) 851 int evil, time_t signon, time_t idle, int type, guint caps)
847 { 852 {
848 struct buddy *b = find_buddy(gc->account, name); 853 struct buddy *b = gaim_find_buddy(gc->account, name);
849 854
850 if (signon && (gc->prpl->options & OPT_PROTO_CORRECT_TIME)) { 855 if (signon && (gc->prpl->options & OPT_PROTO_CORRECT_TIME)) {
851 char *tmp = g_strdup(normalize(name)); 856 char *tmp = g_strdup(normalize(name));
852 if (!g_strcasecmp(tmp, normalize(gc->username))) { 857 if (!g_strcasecmp(tmp, normalize(gc->username))) {
853 gc->evil = evil; 858 gc->evil = evil;
854 gc->correction_time = (signon - gc->login_time); 859 gc->correction_time = (signon - gc->login_time);
855 update_idle_times(); 860 /*update_idle_times();*/
856 } 861 }
857 g_free(tmp); 862 g_free(tmp);
858 } 863 }
859 864
860 if (!b) { 865 if (!b) {
864 869
865 /* This code will 'align' the name from the TOC */ 870 /* This code will 'align' the name from the TOC */
866 /* server with what's in our record. We want to */ 871 /* server with what's in our record. We want to */
867 /* store things how THEY want it... */ 872 /* store things how THEY want it... */
868 if (strcmp(name, b->name)) { 873 if (strcmp(name, b->name)) {
869 char *who = g_strdup(b->name); 874 gaim_blist_rename_buddy(b, name);
870 g_snprintf(b->name, sizeof(b->name), "%s", name);
871 handle_buddy_rename(b, who);
872 gaim_blist_save(); 875 gaim_blist_save();
873 g_free(who);
874 } 876 }
875 877
876 if (!b->idle && idle) { 878 if (!b->idle && idle) {
877 plugin_event(event_buddy_idle, gc, b->name); 879 plugin_event(event_buddy_idle, gc, b->name);
878 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE); 880 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE);
881 do_pounce(gc, b->name, OPT_POUNCE_UNIDLE); 883 do_pounce(gc, b->name, OPT_POUNCE_UNIDLE);
882 plugin_event(event_buddy_unidle, gc, b->name); 884 plugin_event(event_buddy_unidle, gc, b->name);
883 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE); 885 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE);
884 } 886 }
885 887
886 b->idle = idle; 888 gaim_blist_update_buddy_idle(b, idle);
887 b->evil = evil; 889 gaim_blist_update_buddy_evil(b, evil);
888 890
889 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { 891 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) {
890 do_pounce(gc, b->name, OPT_POUNCE_UNAWAY); 892 do_pounce(gc, b->name, OPT_POUNCE_UNAWAY);
891 plugin_event(event_buddy_back, gc, b->name); 893 plugin_event(event_buddy_back, gc, b->name);
892 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); 894 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY);
893 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) { 895 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) {
894 plugin_event(event_buddy_away, gc, b->name); 896 plugin_event(event_buddy_away, gc, b->name);
895 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); 897 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY);
896 } 898 }
897 899
898 b->uc = type; 900 gaim_blist_update_buddy_status(b, type);
899 if (caps) 901
900 b->caps = caps; 902 gaim_blist_update_buddy_presence(b, loggedin);
901
902 b->signon = signon;
903 903
904 if (loggedin) { 904 if (loggedin) {
905 if (!b->present) { 905 if (!b->present) {
906 b->present = 1; 906 //b->present = 1;
907 do_pounce(gc, b->name, OPT_POUNCE_SIGNON); 907 do_pounce(gc, b->name, OPT_POUNCE_SIGNON);
908 plugin_event(event_buddy_signon, gc, b->name); 908 plugin_event(event_buddy_signon, gc, b->name);
909 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); 909 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON);
910 } 910 }
911 } else { 911 } else {
913 plugin_event(event_buddy_signoff, gc, b->name); 913 plugin_event(event_buddy_signoff, gc, b->name);
914 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); 914 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON);
915 } 915 }
916 b->present = 0; 916 b->present = 0;
917 } 917 }
918
919 set_buddy(gc, b);
920 } 918 }
921 919
922 920
923 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev) 921 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev)
924 { 922 {