Mercurial > pidgin
comparison src/server.c @ 9594:15d09e546cee
[gaim-migrate @ 10437]
I changed the 2 preferences dealing with auto-responses.
It's a drop down box. Check it out.
I also made Gaim not load .gaimrc
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 25 Jul 2004 22:13:03 +0000 |
parents | fe35f55ee984 |
children | 1b13160bf5a4 |
comparison
equal
deleted
inserted
replaced
9593:a64febebdd1e | 9594:15d09e546cee |
---|---|
258 GaimConvImFlags imflags) | 258 GaimConvImFlags imflags) |
259 { | 259 { |
260 GaimConversation *c; | 260 GaimConversation *c; |
261 int val = -EINVAL; | 261 int val = -EINVAL; |
262 GaimPluginProtocolInfo *prpl_info = NULL; | 262 GaimPluginProtocolInfo *prpl_info = NULL; |
263 const gchar *auto_reply_pref; | |
263 | 264 |
264 if (gc != NULL && gc->prpl != NULL) | 265 if (gc != NULL && gc->prpl != NULL) |
265 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); | 266 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
266 | 267 |
267 c = gaim_find_conversation_with_account(name, gc->account); | 268 c = gaim_find_conversation_with_account(name, gc->account); |
270 val = prpl_info->send_im(gc, name, message, imflags); | 271 val = prpl_info->send_im(gc, name, message, imflags); |
271 | 272 |
272 if (!(imflags & GAIM_CONV_IM_AUTO_RESP)) | 273 if (!(imflags & GAIM_CONV_IM_AUTO_RESP)) |
273 serv_touch_idle(gc); | 274 serv_touch_idle(gc); |
274 | 275 |
276 /* | |
277 * XXX - If "only auto-reply when away & idle" is set, then shouldn't | |
278 * this only reset lar->sent if we're away AND idle? | |
279 */ | |
280 auto_reply_pref = gaim_prefs_get_string("/core/away/auto_reply"); | |
275 if (gc->away && (gc->flags & GAIM_CONNECTION_AUTO_RESP) && | 281 if (gc->away && (gc->flags & GAIM_CONNECTION_AUTO_RESP) && |
276 gaim_prefs_get_bool("/core/away/auto_response/enabled")) { | 282 strcmp(auto_reply_pref, "never")) { |
277 | 283 |
278 struct last_auto_response *lar; | 284 struct last_auto_response *lar; |
279 lar = get_last_auto_response(gc, name); | 285 lar = get_last_auto_response(gc, name); |
280 lar->sent = time(NULL); | 286 lar->sent = time(NULL); |
281 } | 287 } |
895 char *tmpmsg; | 901 char *tmpmsg; |
896 GaimBuddy *b = gaim_find_buddy(gc->account, name); | 902 GaimBuddy *b = gaim_find_buddy(gc->account, name); |
897 const char *alias = b ? gaim_get_buddy_alias(b) : name; | 903 const char *alias = b ? gaim_get_buddy_alias(b) : name; |
898 int row; | 904 int row; |
899 struct last_auto_response *lar; | 905 struct last_auto_response *lar; |
906 const gchar *auto_reply_pref; | |
900 | 907 |
901 /* | 908 /* |
902 * Either we're going to queue it or not. Because of the way | 909 * Either we're going to queue it or not. Because of the way |
903 * awayness currently works, this is fucked up. It's possible | 910 * awayness currently works, this is fucked up. It's possible |
904 * for an account to be away without the imaway dialog being | 911 * for an account to be away without the imaway dialog being |
970 * Regardless of whether we queue it or not, we should send an | 977 * Regardless of whether we queue it or not, we should send an |
971 * auto-response. That is, of course, unless the horse.... no wait. | 978 * auto-response. That is, of course, unless the horse.... no wait. |
972 * Don't autorespond if: | 979 * Don't autorespond if: |
973 * | 980 * |
974 * - it's not supported on this connection | 981 * - it's not supported on this connection |
982 * - or the away message is empty | |
975 * - or it's disabled | 983 * - or it's disabled |
976 * - or the away message is empty | |
977 * - or we're not idle and the 'only auto respond if idle' pref | 984 * - or we're not idle and the 'only auto respond if idle' pref |
978 * is set | 985 * is set |
979 */ | 986 */ |
987 auto_reply_pref = gaim_prefs_get_string("/core/away/auto_reply"); | |
980 if (!(gc->flags & GAIM_CONNECTION_AUTO_RESP) || | 988 if (!(gc->flags & GAIM_CONNECTION_AUTO_RESP) || |
981 !gaim_prefs_get_bool("/core/away/auto_response/enabled") || | |
982 *gc->away == '\0' || | 989 *gc->away == '\0' || |
990 !strcmp(auto_reply_pref, "never") || | |
983 (!gc->is_idle && | 991 (!gc->is_idle && |
984 gaim_prefs_get_bool("/core/away/auto_response/idle_only"))) { | 992 !strcmp(auto_reply_pref, "awayidle"))) { |
985 | 993 |
986 g_free(name); | 994 g_free(name); |
987 g_free(message); | 995 g_free(message); |
988 return; | 996 return; |
989 } | 997 } |