Changeset bb09b3c for protocols/nogaim.c


Ignore:
Timestamp:
2010-06-03T21:13:57Z (14 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
1dd3470
Parents:
a6b2f13 (diff), df1ae622 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge in bitlbee 1.2.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    ra6b2f13 rbb09b3c  
    657657        u->away = u->status_msg = NULL;
    658658       
    659         if( ( flags & OPT_LOGGED_IN ) && !u->online )
    660         {
     659        if( set_getbool( &ic->irc->set, "show_offline" ) && !u->online )
     660        {
     661                /* always set users as online */
    661662                irc_spawn( ic->irc, u );
    662663                u->online = 1;
     664                if( !( flags & OPT_LOGGED_IN ) )
     665                {
     666                        /* set away message if user isn't really online */
     667                        u->away = g_strdup( "User is offline" );
     668                }
     669        }
     670        else if( ( flags & OPT_LOGGED_IN ) && !u->online )
     671        {
     672                irc_spawn( ic->irc, u );
     673                u->online = 1;
    663674        }
    664675        else if( !( flags & OPT_LOGGED_IN ) && u->online )
     
    666677                struct groupchat *c;
    667678               
    668                 irc_kill( ic->irc, u );
    669                 u->online = 0;
    670                
    671                 /* Remove him/her from the groupchats to prevent PART messages after he/she QUIT already */
    672                 for( c = ic->groupchats; c; c = c->next )
    673                         remove_chat_buddy_silent( c, handle );
    674         }
    675        
     679                if( set_getbool( &ic->irc->set, "show_offline" ) )
     680                {
     681                        /* keep offline users in channel and set away message to "offline" */
     682                        u->away = g_strdup( "User is offline" );
     683
     684                        /* Keep showing him/her in the control channel but not in groupchats. */
     685                        for( c = ic->groupchats; c; c = c->next )
     686                        {
     687                                if( remove_chat_buddy_silent( c, handle ) && c->joined )
     688                                        irc_part( c->ic->irc, u, c->channel );
     689                        }
     690                }
     691                else
     692                {
     693                        /* kill offline users */
     694                        irc_kill( ic->irc, u );
     695                        u->online = 0;
     696
     697                        /* Remove him/her from the groupchats to prevent PART messages after he/she QUIT already */
     698                        for( c = ic->groupchats; c; c = c->next )
     699                                remove_chat_buddy_silent( c, handle );
     700                }
     701        }
     702
    676703        if( flags & OPT_AWAY )
    677704        {
     
    700727        /* LISPy... */
    701728        if( ( u->online ) &&                                            /* Don't touch offline people */
    702             ( ( ( u->online != oo ) && !u->away ) ||                    /* Do joining people */
     729            ( ( u->online != oo ) ||                                    /* Do joining people */
    703730              ( ( u->online == oo ) && ( oa == !u->away ) ) ) )         /* Do people changing state */
    704731        {
     
    714741                                                            ic->irc->myhost );
    715742                }
     743
     744                if(!strcmp(set_getstr(&ic->irc->set, "voice_buddies"), "online")) {
     745                        irc_write( ic->irc, ":%s MODE %s +v %s", from, ic->irc->channel, u->nick );
     746                }
     747                if(!strcmp(set_getstr(&ic->irc->set, "halfop_buddies"), "online")) {
     748                        irc_write( ic->irc, ":%s MODE %s +h %s", from, ic->irc->channel, u->nick );
     749                }
     750                if(!strcmp(set_getstr(&ic->irc->set, "op_buddies"), "online")) {
     751                        irc_write( ic->irc, ":%s MODE %s +o %s", from, ic->irc->channel, u->nick );
     752                }
     753
    716754                if(!strcmp(set_getstr(&ic->irc->set, "voice_buddies"), "notaway")) {
    717755                        irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel,
     
    726764                                                                 u->away?'-':'+', u->nick );
    727765                }
     766
    728767                g_free( from );
    729768        }
     
    11561195                return g_strdup_printf( "\x02[\x02\x02\x02%04d-%02d-%02d "
    11571196                                        "%02d:%02d:%02d\x02]\x02 ",
    1158                                         msg.tm_year + 1900, msg.tm_mon, msg.tm_mday,
     1197                                        msg.tm_year + 1900, msg.tm_mon + 1, msg.tm_mday,
    11591198                                        msg.tm_hour, msg.tm_min, msg.tm_sec );
    11601199}
Note: See TracChangeset for help on using the changeset viewer.