Changeset ec86b22 for protocols/nogaim.c
- Timestamp:
- 2010-05-15T23:28:16Z (14 years ago)
- Branches:
- master
- Children:
- 2309152
- Parents:
- ca0981a (diff), 6e6b3d7 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
rca0981a rec86b22 665 665 u->away = u->status_msg = NULL; 666 666 667 if( ( flags & OPT_LOGGED_IN ) && !u->online ) 668 { 667 if( set_getbool( &ic->irc->set, "show_offline" ) && !u->online ) 668 { 669 /* always set users as online */ 669 670 irc_spawn( ic->irc, u ); 670 671 u->online = 1; 672 if( !( flags & OPT_LOGGED_IN ) ) 673 { 674 /* set away message if user isn't really online */ 675 u->away = g_strdup( "User is offline" ); 676 } 677 } 678 else if( ( flags & OPT_LOGGED_IN ) && !u->online ) 679 { 680 irc_spawn( ic->irc, u ); 681 u->online = 1; 671 682 } 672 683 else if( !( flags & OPT_LOGGED_IN ) && u->online ) … … 674 685 struct groupchat *c; 675 686 676 irc_kill( ic->irc, u ); 677 u->online = 0; 678 679 /* Remove him/her from the groupchats to prevent PART messages after he/she QUIT already */ 680 for( c = ic->groupchats; c; c = c->next ) 681 remove_chat_buddy_silent( c, handle ); 682 } 683 687 if( set_getbool( &ic->irc->set, "show_offline" ) ) 688 { 689 /* keep offline users in channel and set away message to "offline" */ 690 u->away = g_strdup( "User is offline" ); 691 692 /* Keep showing him/her in the control channel but not in groupchats. */ 693 for( c = ic->groupchats; c; c = c->next ) 694 { 695 if( remove_chat_buddy_silent( c, handle ) && c->joined ) 696 irc_part( c->ic->irc, u, c->channel ); 697 } 698 } 699 else 700 { 701 /* kill offline users */ 702 irc_kill( ic->irc, u ); 703 u->online = 0; 704 705 /* Remove him/her from the groupchats to prevent PART messages after he/she QUIT already */ 706 for( c = ic->groupchats; c; c = c->next ) 707 remove_chat_buddy_silent( c, handle ); 708 } 709 } 710 684 711 if( flags & OPT_AWAY ) 685 712 { … … 706 733 } 707 734 708 /* LISPy... */ 709 if( ( set_getbool( &ic->irc->set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */ 710 ( u->online ) && /* Don't touch offline people */ 711 ( ( ( u->online != oo ) && !u->away ) || /* Voice joining people */ 712 ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* (De)voice people changing state */ 735 /* early if-clause for show_offline even if there is some redundant code here because this isn't LISP but C ;) */ 736 if( set_getbool( &ic->irc->set, "show_offline" ) && set_getbool( &ic->irc->set, "away_devoice" ) ) 713 737 { 714 738 char *from; … … 723 747 ic->irc->myhost ); 724 748 } 725 irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, 726 u->away?'-':'+', u->nick ); 727 g_free( from ); 749 750 /* if we use show_offline, we op online users, voice away users, and devoice/deop offline users */ 751 if( flags & OPT_LOGGED_IN ) 752 { 753 /* user is "online" (either really online or away) */ 754 irc_write( ic->irc, ":%s MODE %s %cv%co %s %s", from, ic->irc->channel, 755 u->away?'+':'-', u->away?'-':'+', u->nick, u->nick ); 756 } 757 else 758 { 759 /* user is offline */ 760 irc_write( ic->irc, ":%s MODE %s -vo %s %s", from, ic->irc->channel, u->nick, u->nick ); 761 } 762 } 763 else 764 { 765 /* LISPy... */ 766 if( ( set_getbool( &ic->irc->set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */ 767 ( u->online ) && /* Don't touch offline people */ 768 ( ( ( u->online != oo ) && !u->away ) || /* Voice joining people */ 769 ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* (De)voice people changing state */ 770 { 771 char *from; 772 773 if( set_getbool( &ic->irc->set, "simulate_netsplit" ) ) 774 { 775 from = g_strdup( ic->irc->myhost ); 776 } 777 else 778 { 779 from = g_strdup_printf( "%s!%s@%s", ic->irc->mynick, ic->irc->mynick, 780 ic->irc->myhost ); 781 } 782 irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, 783 u->away?'-':'+', u->nick ); 784 g_free( from ); 785 } 728 786 } 729 787 } … … 1202 1260 return g_strdup_printf( "\x02[\x02\x02\x02%04d-%02d-%02d " 1203 1261 "%02d:%02d:%02d\x02]\x02 ", 1204 msg.tm_year + 1900, msg.tm_mon , msg.tm_mday,1262 msg.tm_year + 1900, msg.tm_mon + 1, msg.tm_mday, 1205 1263 msg.tm_hour, msg.tm_min, msg.tm_sec ); 1206 1264 }
Note: See TracChangeset
for help on using the changeset viewer.