Mercurial > pidgin
comparison src/server.c @ 5032:cb700c07ee07
[gaim-migrate @ 5375]
Rewrote the buddy pounce code. It's now core/UI split, and may allow for
more advanced stuff later. Pounce actions are now a UI thing, and the
backend logic for registering, unregistering, and activating pouncs is now
in core. Also, the buddy pounce dialog was redesigned.
Oh, and there are new pounce types. You can now choose from:
* Sign on
* Sign off
* Away
* Return from away
* Idle
* Return from idle
* Buddy starts typing
* Buddy stops typing
Should work. I've been using it for some time. If you find a bug, though,
let me know.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 05 Apr 2003 10:14:21 +0000 |
| parents | 8e55a4d362a3 |
| children | be31fb7a719e |
comparison
equal
deleted
inserted
replaced
| 5031:bc494c4a3991 | 5032:cb700c07ee07 |
|---|---|
| 860 gaim_blist_rename_buddy(b, name); | 860 gaim_blist_rename_buddy(b, name); |
| 861 gaim_blist_save(); | 861 gaim_blist_save(); |
| 862 } | 862 } |
| 863 | 863 |
| 864 if (!b->idle && idle) { | 864 if (!b->idle && idle) { |
| 865 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_IDLE); | |
| 865 plugin_event(event_buddy_idle, gc, b->name); | 866 plugin_event(event_buddy_idle, gc, b->name); |
| 866 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE); | 867 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE); |
| 867 } | 868 } |
| 868 if (b->idle && !idle) { | 869 if (b->idle && !idle) { |
| 869 do_pounce(gc, b->name, OPT_POUNCE_UNIDLE); | 870 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_IDLE_RETURN); |
| 870 plugin_event(event_buddy_unidle, gc, b->name); | 871 plugin_event(event_buddy_unidle, gc, b->name); |
| 871 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE); | 872 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE); |
| 872 } | 873 } |
| 873 | 874 |
| 874 gaim_blist_update_buddy_idle(b, idle); | 875 gaim_blist_update_buddy_idle(b, idle); |
| 875 gaim_blist_update_buddy_evil(b, evil); | 876 gaim_blist_update_buddy_evil(b, evil); |
| 876 | 877 |
| 877 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { | 878 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) { |
| 878 do_pounce(gc, b->name, OPT_POUNCE_UNAWAY); | 879 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_AWAY_RETURN); |
| 879 plugin_event(event_buddy_back, gc, b->name); | 880 plugin_event(event_buddy_back, gc, b->name); |
| 880 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); | 881 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); |
| 881 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) { | 882 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) { |
| 883 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_AWAY); | |
| 882 plugin_event(event_buddy_away, gc, b->name); | 884 plugin_event(event_buddy_away, gc, b->name); |
| 883 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); | 885 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); |
| 884 } | 886 } |
| 885 | 887 |
| 886 gaim_blist_update_buddy_status(b, type); | 888 gaim_blist_update_buddy_status(b, type); |
| 904 qm->flags = WFLAG_SYSTEM; | 906 qm->flags = WFLAG_SYSTEM; |
| 905 qm->len = -1; | 907 qm->len = -1; |
| 906 message_queue = g_slist_append(message_queue, qm); | 908 message_queue = g_slist_append(message_queue, qm); |
| 907 } | 909 } |
| 908 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); | 910 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); |
| 909 do_pounce(gc, b->name, OPT_POUNCE_SIGNON); | 911 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_SIGNON); |
| 910 plugin_event(event_buddy_signon, gc, b->name); | 912 plugin_event(event_buddy_signon, gc, b->name); |
| 911 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); | 913 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); |
| 912 } | 914 } |
| 913 } else { | 915 } else { |
| 914 if (b->present == 1) { | 916 if (b->present == 1) { |
| 928 qm->flags = WFLAG_SYSTEM; | 930 qm->flags = WFLAG_SYSTEM; |
| 929 qm->len = -1; | 931 qm->len = -1; |
| 930 message_queue = g_slist_append(message_queue, qm); | 932 message_queue = g_slist_append(message_queue, qm); |
| 931 } | 933 } |
| 932 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); | 934 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); |
| 935 gaim_pounce_execute(gc->account, b->name, GAIM_POUNCE_SIGNOFF); | |
| 933 plugin_event(event_buddy_signoff, gc, b->name); | 936 plugin_event(event_buddy_signoff, gc, b->name); |
| 934 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); | 937 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); |
| 935 } | 938 } |
| 936 } | 939 } |
| 937 | 940 |
| 963 } | 966 } |
| 964 | 967 |
| 965 void serv_got_typing(struct gaim_connection *gc, char *name, int timeout, | 968 void serv_got_typing(struct gaim_connection *gc, char *name, int timeout, |
| 966 int state) { | 969 int state) { |
| 967 | 970 |
| 971 struct buddy *b; | |
| 968 struct gaim_conversation *cnv = gaim_find_conversation(name); | 972 struct gaim_conversation *cnv = gaim_find_conversation(name); |
| 969 struct gaim_im *im; | 973 struct gaim_im *im; |
| 970 | 974 |
| 971 if (!cnv) | 975 if (!cnv) |
| 972 return; | 976 return; |
| 975 | 979 |
| 976 gaim_conversation_set_account(cnv, gc->account); | 980 gaim_conversation_set_account(cnv, gc->account); |
| 977 gaim_im_set_typing_state(im, state); | 981 gaim_im_set_typing_state(im, state); |
| 978 gaim_im_update_typing(im); | 982 gaim_im_update_typing(im); |
| 979 | 983 |
| 984 b = gaim_find_buddy(gc->account, name); | |
| 985 | |
| 980 plugin_event(event_got_typing, gc, name); | 986 plugin_event(event_got_typing, gc, name); |
| 981 do_pounce(gc, name, OPT_POUNCE_TYPING); | 987 |
| 988 if (b != NULL) | |
| 989 gaim_pounce_execute(gc->account, name, GAIM_POUNCE_TYPING); | |
| 982 | 990 |
| 983 if (timeout > 0) | 991 if (timeout > 0) |
| 984 gaim_im_start_typing_timeout(im, timeout); | 992 gaim_im_start_typing_timeout(im, timeout); |
| 985 } | 993 } |
| 986 | 994 |
| 987 void serv_got_typing_stopped(struct gaim_connection *gc, char *name) { | 995 void serv_got_typing_stopped(struct gaim_connection *gc, char *name) { |
| 988 | 996 |
| 989 struct gaim_conversation *c = gaim_find_conversation(name); | 997 struct gaim_conversation *c = gaim_find_conversation(name); |
| 990 struct gaim_im *im; | 998 struct gaim_im *im; |
| 999 struct buddy *b; | |
| 991 | 1000 |
| 992 if (!c) | 1001 if (!c) |
| 993 return; | 1002 return; |
| 994 | 1003 |
| 995 im = GAIM_IM(c); | 1004 im = GAIM_IM(c); |
| 996 | 1005 |
| 997 gaim_im_stop_typing_timeout(im); | 1006 gaim_im_stop_typing_timeout(im); |
| 998 gaim_im_set_typing_state(im, NOT_TYPING); | 1007 gaim_im_set_typing_state(im, NOT_TYPING); |
| 999 gaim_im_update_typing(im); | 1008 gaim_im_update_typing(im); |
| 1009 | |
| 1010 b = gaim_find_buddy(gc->account, name); | |
| 1011 | |
| 1012 if (b != NULL) | |
| 1013 gaim_pounce_execute(gc->account, name, GAIM_POUNCE_TYPING_STOPPED); | |
| 1000 } | 1014 } |
| 1001 | 1015 |
| 1002 struct chat_invite_data { | 1016 struct chat_invite_data { |
| 1003 struct gaim_connection *gc; | 1017 struct gaim_connection *gc; |
| 1004 GList *str; | 1018 GList *str; |
