From 118638279f7a39422d9e07365b380fa773c5243e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 10 Oct 2007 23:15:59 +0100 Subject: Made the netsplit-like quit messages optional. --- protocols/nogaim.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 9ebd048e..d7b26b74 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -585,8 +585,20 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, ( ( ( u->online != oo ) && !u->away ) || /* Voice joining people */ ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* (De)voice people changing state */ { - irc_write( ic->irc, ":%s MODE %s %cv %s", ic->irc->myhost, - ic->irc->channel, u->away?'-':'+', u->nick ); + char *from; + + if( set_getbool( &ic->irc->set, "simulate_netsplit" ) ) + { + from = g_strdup( ic->irc->myhost ); + } + else + { + from = g_strdup_printf( "%s!%s@%s", ic->irc->mynick, ic->irc->mynick, + ic->irc->myhost ); + } + irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, + u->away?'-':'+', u->nick ); + g_free( from ); } } -- cgit v1.2.3