aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-01-05 21:15:32 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-01-05 21:15:32 +0000
commit1febf5c93b231942cd9cac8ac6a5a0d830c581cc (patch)
treeb9ab00aa08457cbf0b91301f712d8b3af1f601e4 /protocols
parent6e68a52f92dea3a75ad4daad4867f9542506deae (diff)
Added "mail_notifications" setting. Who needs those notifications anyway?
Closes: #338.
Diffstat (limited to 'protocols')
-rw-r--r--protocols/msn/msn.c2
-rw-r--r--protocols/msn/ns.c4
-rw-r--r--protocols/yahoo/yahoo.c10
3 files changed, 13 insertions, 3 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c
index aa05dbdd..192dda0a 100644
--- a/protocols/msn/msn.c
+++ b/protocols/msn/msn.c
@@ -34,6 +34,8 @@ static void msn_init( account_t *acc )
s = set_add( &acc->set, "display_name", NULL, msn_set_display_name, acc );
s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY;
+
+ s = set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
}
static void msn_login( account_t *acc )
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c
index 9bd7f152..3735aad6 100644
--- a/protocols/msn/ns.c
+++ b/protocols/msn/ns.c
@@ -642,7 +642,7 @@ static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int
char *inbox = msn_findheader( body, "Inbox-Unread:", blen );
char *folders = msn_findheader( body, "Folders-Unread:", blen );
- if( inbox && folders )
+ if( inbox && folders && set_getbool( &ic->acc->set, "mail_notifications" ) )
{
imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
}
@@ -652,7 +652,7 @@ static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int
char *from = msn_findheader( body, "From-Addr:", blen );
char *fromname = msn_findheader( body, "From:", blen );
- if( from && fromname )
+ if( from && fromname && set_getbool( &ic->acc->set, "mail_notifications" ) )
{
imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
}
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c
index 625f3d1c..d413597a 100644
--- a/protocols/yahoo/yahoo.c
+++ b/protocols/yahoo/yahoo.c
@@ -126,6 +126,11 @@ static char *byahoo_strip( const char *in )
return( g_strndup( in, len ) );
}
+static void byahoo_init( account_t *acc )
+{
+ set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
+}
+
static void byahoo_login( account_t *acc )
{
struct im_connection *ic = imcb_new( acc );
@@ -348,6 +353,7 @@ void byahoo_initmodule( )
{
struct prpl *ret = g_new0(struct prpl, 1);
ret->name = "yahoo";
+ ret->init = byahoo_init;
ret->login = byahoo_login;
ret->keepalive = byahoo_keepalive;
@@ -922,7 +928,9 @@ void ext_yahoo_mail_notify( int id, const char *from, const char *subj, int cnt
{
struct im_connection *ic = byahoo_get_ic_by_id( id );
- if( from && subj )
+ if( !set_getbool( &ic->acc->set, "mail_notifications" ) )
+ ; /* The user doesn't care. */
+ else if( from && subj )
imcb_log( ic, "Received e-mail message from %s with subject `%s'", from, subj );
else if( cnt > 0 )
imcb_log( ic, "Received %d new e-mails", cnt );