Changeset 13c1a9f
- Timestamp:
- 2010-05-09T21:52:17Z (15 years ago)
- Branches:
- master
- Children:
- 4e608d6
- Parents:
- 3130e70
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r3130e70 r13c1a9f 261 261 char *irc_format_timestamp( irc_t *irc, time_t msg_ts ); 262 262 263 /* irc_im.c */ 264 void bee_irc_channel_update( irc_t *irc, irc_channel_t *ic, irc_user_t *iu ); 265 263 266 #endif -
irc_channel.c
r3130e70 r13c1a9f 263 263 icc->type = IRC_CC_TYPE_DEFAULT; 264 264 265 if( ( icc->group = bee_group_by_name( ic->irc->b, ic->name + 1, FALSE ) ) ) 266 icc->type = IRC_CC_TYPE_GROUP; 267 268 bee_irc_channel_update( ic->irc, ic, NULL ); 269 265 270 return TRUE; 266 271 } -
irc_im.c
r3130e70 r13c1a9f 81 81 irc_t *irc = bee->ui_data; 82 82 irc_user_t *iu = bu->ui_data; 83 irc_channel_t *ic = irc->default_channel;84 83 85 84 /* Do this outside the if below since away state can change without … … 96 95 irc_send_num( irc, 600, "%s %s %s %d :%s", iu->nick, iu->user, 97 96 iu->host, (int) time( NULL ), "logged online" ); 98 99 irc_channel_add_user( ic, iu );100 101 if( set_getbool( &bee->set, "away_devoice" ) )102 irc_channel_user_set_mode( ic, iu, ( bu->flags & BEE_USER_AWAY ) ?103 0 : IRC_CHANNEL_USER_VOICE );104 97 } 105 98 else … … 108 101 irc_send_num( irc, 601, "%s %s %s %d :%s", iu->nick, iu->user, 109 102 iu->host, (int) time( NULL ), "logged offline" ); 110 111 irc_channel_del_user( ic, iu ); 112 } 113 } 114 115 return TRUE; 103 } 104 } 105 106 bee_irc_channel_update( irc, NULL, iu ); 107 108 return TRUE; 109 } 110 111 void bee_irc_channel_update( irc_t *irc, irc_channel_t *ic, irc_user_t *iu ) 112 { 113 struct irc_control_channel *icc; 114 GSList *l; 115 gboolean show; 116 117 if( ic == NULL ) 118 { 119 for( l = irc->channels; l; l = l->next ) 120 { 121 ic = l->data; 122 /* TODO: Just add a type flag or so.. */ 123 if( ic->f == irc->default_channel->f ) 124 bee_irc_channel_update( irc, ic, iu ); 125 } 126 return; 127 } 128 if( iu == NULL ) 129 { 130 for( l = irc->users; l; l = l->next ) 131 { 132 iu = l->data; 133 if( iu->bu ) 134 bee_irc_channel_update( irc, ic, l->data ); 135 } 136 return; 137 } 138 139 icc = ic->data; 140 141 if( !( iu->bu->flags & BEE_USER_ONLINE ) ) 142 show = FALSE; 143 else if( icc->type == IRC_CC_TYPE_DEFAULT ) 144 show = TRUE; 145 else if( icc->type == IRC_CC_TYPE_GROUP ) 146 show = iu->bu->group == icc->group; 147 148 if( !show ) 149 { 150 irc_channel_del_user( ic, iu ); 151 } 152 else 153 { 154 irc_channel_add_user( ic, iu ); 155 156 if( set_getbool( &irc->b->set, "away_devoice" ) ) 157 irc_channel_user_set_mode( ic, iu, ( iu->bu->flags & BEE_USER_AWAY ) ? 158 0 : IRC_CHANNEL_USER_VOICE ); 159 } 116 160 } 117 161
Note: See TracChangeset
for help on using the changeset viewer.