Mercurial > hg
comparison mcabber/src/hooks.c @ 318:45076d02eeef
The /status command can specify a status message
We can now use: "/status dnd On the phone..."
Related change: Display the buddy status message when a buddy connects/changes
his/her status.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 15 Jul 2005 18:45:41 +0100 |
parents | f562b9af2de7 |
children | ff6fb51bfd78 |
comparison
equal
deleted
inserted
replaced
317:f2d29644a0df | 318:45076d02eeef |
---|---|
63 } | 63 } |
64 | 64 |
65 inline void hk_statuschange(const char *jid, time_t timestamp, | 65 inline void hk_statuschange(const char *jid, time_t timestamp, |
66 enum imstatus status, const char *status_msg) | 66 enum imstatus status, const char *status_msg) |
67 { | 67 { |
68 scr_LogPrint("Buddy status has changed: [%c>%c] <%s>", | 68 scr_LogPrint("Buddy status has changed: [%c>%c] <%s> %s", |
69 imstatus2char[roster_getstatus(jid)], imstatus2char[status], jid); | 69 imstatus2char[roster_getstatus(jid)], imstatus2char[status], jid, |
70 ((status_msg) ? status_msg : "")); | |
70 roster_setstatus(jid, status, status_msg); | 71 roster_setstatus(jid, status, status_msg); |
71 buddylist_build(); | 72 buddylist_build(); |
72 scr_DrawRoster(); | 73 scr_DrawRoster(); |
73 hlog_write_status(jid, 0, status, status_msg); | 74 hlog_write_status(jid, 0, status, status_msg); |
74 } | 75 } |
75 | 76 |
76 inline void hk_mystatuschange(time_t timestamp, | 77 inline void hk_mystatuschange(time_t timestamp, |
77 enum imstatus old_status, enum imstatus new_status) | 78 enum imstatus old_status, enum imstatus new_status, const char *msg) |
78 { | 79 { |
79 if (old_status == new_status) | 80 if (!msg && (old_status == new_status)) |
80 return; | 81 return; |
81 | 82 |
82 scr_LogPrint("Your status has changed: [%c>%c]", | 83 scr_LogPrint("Your status has changed: [%c>%c] %s", |
83 imstatus2char[old_status], imstatus2char[new_status]); | 84 imstatus2char[old_status], imstatus2char[new_status], |
85 ((msg) ? msg : "")); | |
84 //hlog_write_status(NULL, 0, status); | 86 //hlog_write_status(NULL, 0, status); |
85 } | 87 } |
86 | 88 |
87 | 89 |
88 /* External commands */ | 90 /* External commands */ |