Mercurial > pidgin
comparison src/server.c @ 4767:f6d83e81d45a
[gaim-migrate @ 5085]
This brings back:
- Sounds
- "SeanEgn logged in." messages
- Plugin and perl events
- Raise Buddy list on events
- I think that's all.
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Fri, 14 Mar 2003 08:10:17 +0000 |
| parents | a979ce8ec806 |
| children | c4c28874ecd3 |
comparison
equal
deleted
inserted
replaced
| 4766:03aa36cb4e38 | 4767:f6d83e81d45a |
|---|---|
| 33 #include <errno.h> | 33 #include <errno.h> |
| 34 #include "gtkimhtml.h" | 34 #include "gtkimhtml.h" |
| 35 #include "prpl.h" | 35 #include "prpl.h" |
| 36 #include "multi.h" | 36 #include "multi.h" |
| 37 #include "gaim.h" | 37 #include "gaim.h" |
| 38 #include "sound.h" | |
| 38 | 39 |
| 39 #include "pixmaps/cancel.xpm" | 40 #include "pixmaps/cancel.xpm" |
| 40 #include "pixmaps/tb_search.xpm" | 41 #include "pixmaps/tb_search.xpm" |
| 41 | 42 |
| 42 #include "pounce.h" | 43 #include "pounce.h" |
| 897 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); | 898 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); |
| 898 } | 899 } |
| 899 | 900 |
| 900 gaim_blist_update_buddy_status(b, type); | 901 gaim_blist_update_buddy_status(b, type); |
| 901 | 902 |
| 902 gaim_blist_update_buddy_presence(b, loggedin); | |
| 903 | 903 |
| 904 if (loggedin) { | 904 if (loggedin) { |
| 905 if (!b->present) { | 905 if (!b->present == 1) { |
| 906 //b->present = 1; | 906 struct gaim_conversation *c = gaim_find_conversation(b->name); |
| 907 if (c) { | |
| 908 char *tmp = g_strdup_printf(_("%s logged in."), gaim_get_buddy_alias(b)); | |
| 909 gaim_conversation_write(c, NULL, tmp, -1, | |
| 910 WFLAG_SYSTEM, time(NULL)); | |
| 911 g_free(tmp); | |
| 912 } else if (awayqueue && find_queue_total_by_name(b->name)) { | |
| 913 struct queued_message *qm = g_new0(struct queued_message, 1); | |
| 914 g_snprintf(qm->name, sizeof(qm->name), "%s", b->name); | |
| 915 qm->message = g_strdup_printf(_("%s logged in."), | |
| 916 gaim_get_buddy_alias(b)); | |
| 917 qm->account = gc->account; | |
| 918 qm->tm = time(NULL); | |
| 919 qm->flags = WFLAG_SYSTEM; | |
| 920 qm->len = -1; | |
| 921 message_queue = g_slist_append(message_queue, qm); | |
| 922 } | |
| 923 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); | |
| 907 do_pounce(gc, b->name, OPT_POUNCE_SIGNON); | 924 do_pounce(gc, b->name, OPT_POUNCE_SIGNON); |
| 908 plugin_event(event_buddy_signon, gc, b->name); | 925 plugin_event(event_buddy_signon, gc, b->name); |
| 909 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); | 926 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); |
| 910 } | 927 } |
| 911 } else { | 928 } else { |
| 912 if (b->present) { | 929 if (b->present == 1) { |
| 930 struct gaim_conversation *c = gaim_find_conversation(b->name); | |
| 931 if (c) { | |
| 932 char *tmp = g_strdup_printf(_("%s logged out."), gaim_get_buddy_alias(b)); | |
| 933 gaim_conversation_write(c, NULL, tmp, -1, | |
| 934 WFLAG_SYSTEM, time(NULL)); | |
| 935 g_free(tmp); | |
| 936 } else if (awayqueue && find_queue_total_by_name(b->name)) { | |
| 937 struct queued_message *qm = g_new0(struct queued_message, 1); | |
| 938 g_snprintf(qm->name, sizeof(qm->name), "%s", b->name); | |
| 939 qm->message = g_strdup_printf(_("%s logged out."), | |
| 940 gaim_get_buddy_alias(b)); | |
| 941 qm->account = gc->account; | |
| 942 qm->tm = time(NULL); | |
| 943 qm->flags = WFLAG_SYSTEM; | |
| 944 qm->len = -1; | |
| 945 message_queue = g_slist_append(message_queue, qm); | |
| 946 } | |
| 947 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); | |
| 913 plugin_event(event_buddy_signoff, gc, b->name); | 948 plugin_event(event_buddy_signoff, gc, b->name); |
| 914 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); | 949 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); |
| 915 } | 950 } |
| 916 b->present = 0; | 951 } |
| 917 } | 952 |
| 953 gaim_blist_update_buddy_presence(b, loggedin); | |
| 954 | |
| 918 } | 955 } |
| 919 | 956 |
| 920 | 957 |
| 921 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev) | 958 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev) |
| 922 { | 959 { |
