From 59fe32189b18f9797347c5be2de77c03fa4a11d0 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 19 Sep 2002 01:41:38 +0000 Subject: If we get an ALERT, pass it to the user. An rfc2060 MUST, and bug #22496. 2002-09-18 Not Zed * providers/imap/camel-imap-command.c (camel_imap_command_response): If we get an ALERT, pass it to the user. An rfc2060 MUST, and bug #22496. svn path=/trunk/; revision=18107 --- camel/providers/imap/camel-imap-command.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'camel/providers') diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c index e3581c80af..f12a4a55fb 100644 --- a/camel/providers/imap/camel-imap-command.c +++ b/camel/providers/imap/camel-imap-command.c @@ -42,6 +42,7 @@ #include #include #include +#include #define d(x) x @@ -318,6 +319,15 @@ camel_imap_command_response (CamelImapStore *store, char **response, respbuf = imap_read_untagged (store, respbuf, ex); if (!respbuf) type = CAMEL_IMAP_RESPONSE_ERROR; + else if (!g_strncasecmp(respbuf, "* OK [ALERT]", 12)) { + char *msg; + + /* for imap ALERT codes, account user@host */ + msg = g_strdup_printf(_("Alert from IMAP server %s@%s:\n%s"), + ((CamelService *)store)->url->user, ((CamelService *)store)->url->host, respbuf+12); + camel_session_alert_user(((CamelService *)store)->session, CAMEL_SESSION_ALERT_WARNING, msg, FALSE); + g_free(msg); + } break; case '+': -- cgit v1.2.3