Changes in / [b72caac:df417ca]
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
rb72caac rdf417ca 228 228 irc->w_watch_source_id = 0; 229 229 230 if( irc->status &USTATUS_SHUTDOWN )230 if( irc->status == USTATUS_SHUTDOWN ) 231 231 irc_free( irc ); 232 232 -
ipc.c
rb72caac rdf417ca 115 115 static void ipc_child_cmd_wallops( irc_t *irc, char **cmd ) 116 116 { 117 if( !( irc->status & USTATUS_LOGGED_IN ))117 if( irc->status < USTATUS_LOGGED_IN ) 118 118 return; 119 119 … … 124 124 static void ipc_child_cmd_lilo( irc_t *irc, char **cmd ) 125 125 { 126 if( !( irc->status & USTATUS_LOGGED_IN ))126 if( irc->status < USTATUS_LOGGED_IN ) 127 127 return; 128 128 … … 133 133 static void ipc_child_cmd_opermsg( irc_t *irc, char **cmd ) 134 134 { 135 if( !( irc->status & USTATUS_LOGGED_IN ))135 if( irc->status < USTATUS_LOGGED_IN ) 136 136 return; 137 137 … … 154 154 static void ipc_child_cmd_kill( irc_t *irc, char **cmd ) 155 155 { 156 if( !( irc->status & USTATUS_LOGGED_IN ))156 if( irc->status < USTATUS_LOGGED_IN ) 157 157 return; 158 158 … … 166 166 static void ipc_child_cmd_hello( irc_t *irc, char **cmd ) 167 167 { 168 if( !( irc->status & USTATUS_LOGGED_IN ))168 if( irc->status < USTATUS_LOGGED_IN ) 169 169 ipc_to_master_str( "HELLO\r\n" ); 170 170 else -
irc.c
rb72caac rdf417ca 177 177 } 178 178 179 irc->status |= USTATUS_SHUTDOWN;179 irc->status = USTATUS_SHUTDOWN; 180 180 if( irc->sendbuffer && !immed ) 181 181 { … … 211 211 log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd ); 212 212 213 if( irc->status &USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) )213 if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) ) 214 214 if( storage_save( irc, TRUE ) != STORAGE_OK ) 215 215 irc_usermsg( irc, "Error while saving settings!" ); … … 707 707 if( irc->user && irc->nick ) 708 708 { 709 if( global.conf->authmode == AUTHMODE_CLOSED && !( irc->status & USTATUS_AUTHORIZED ))709 if( global.conf->authmode == AUTHMODE_CLOSED && irc->status < USTATUS_AUTHORIZED ) 710 710 { 711 711 irc_reply( irc, 464, ":This server is password-protected." ); … … 764 764 ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname ); 765 765 766 irc->status |= USTATUS_LOGGED_IN;766 irc->status = USTATUS_LOGGED_IN; 767 767 } 768 768 … … 905 905 void irc_kill( irc_t *irc, user_t *u ) 906 906 { 907 char *nick, *s; 908 char reason[64]; 909 910 if( u->gc && u->gc->flags & OPT_LOGGING_OUT ) 911 { 912 if( u->gc->user->proto_opt[0][0] ) 913 g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost, 914 u->gc->user->proto_opt[0] ); 915 else if( ( s = strchr( u->gc->username, '@' ) ) ) 916 g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost, 917 s + 1 ); 918 else 919 g_snprintf( reason, sizeof( reason ), "%s %s.%s", irc->myhost, 920 u->gc->prpl->name, irc->myhost ); 921 922 /* proto_opt might contain garbage after the : */ 923 if( ( s = strchr( reason, ':' ) ) ) 924 *s = 0; 925 } 926 else 927 { 928 strcpy( reason, "Leaving..." ); 929 } 930 931 irc_write( irc, ":%s!%s@%s QUIT :%s", u->nick, u->user, u->host, reason ); 907 char *nick; 908 909 irc_write( irc, ":%s!%s@%s QUIT :%s", u->nick, u->user, u->host, "Leaving..." ); 932 910 933 911 nick = g_strdup( u->nick ); … … 1187 1165 int rv = 0; 1188 1166 1189 if( !( irc->status & USTATUS_LOGGED_IN ))1167 if( irc->status < USTATUS_LOGGED_IN ) 1190 1168 { 1191 1169 if( gettime() > ( irc->last_pong + IRC_LOGIN_TIMEOUT ) ) -
irc.h
rb72caac rdf417ca 42 42 { 43 43 USTATUS_OFFLINE = 0, 44 USTATUS_AUTHORIZED = 1,45 USTATUS_LOGGED_IN = 2,46 USTATUS_IDENTIFIED = 4,47 USTATUS_SHUTDOWN = 844 USTATUS_AUTHORIZED, 45 USTATUS_LOGGED_IN, 46 USTATUS_IDENTIFIED, 47 USTATUS_SHUTDOWN = -1 48 48 } irc_status_t; 49 49 -
irc_commands.c
rb72caac rdf417ca 32 32 if( global.conf->auth_pass && strcmp( cmd[1], global.conf->auth_pass ) == 0 ) 33 33 { 34 irc->status |= USTATUS_AUTHORIZED;34 irc->status = USTATUS_AUTHORIZED; 35 35 irc_check_login( irc ); 36 36 } … … 610 610 for( n_arg = 0; cmd[n_arg]; n_arg ++ ); n_arg --; 611 611 612 if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status &USTATUS_LOGGED_IN )612 if( irc_commands[i].flags & IRC_CMD_PRE_LOGIN && irc->status >= USTATUS_LOGGED_IN ) 613 613 { 614 614 irc_reply( irc, 462, ":Only allowed before logging in" ); 615 615 } 616 else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && !( irc->status & USTATUS_LOGGED_IN ))616 else if( irc_commands[i].flags & IRC_CMD_LOGGED_IN && irc->status < USTATUS_LOGGED_IN ) 617 617 { 618 618 irc_reply( irc, 451, ":Register first" ); -
protocols/msn/msn.c
rb72caac rdf417ca 64 64 GSList *l; 65 65 66 if( md ) 67 { 68 if( md->fd >= 0 ) 69 closesocket( md->fd ); 70 71 if( md->handler ) 72 { 73 if( md->handler->rxq ) g_free( md->handler->rxq ); 74 if( md->handler->cmd_text ) g_free( md->handler->cmd_text ); 75 g_free( md->handler ); 76 } 77 78 while( md->switchboards ) 79 msn_sb_destroy( md->switchboards->data ); 80 81 if( md->msgq ) 82 { 83 struct msn_message *m; 84 85 for( l = md->msgq; l; l = l->next ) 86 { 87 m = l->data; 88 89 serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who ); 90 g_free( m->who ); 91 g_free( m->text ); 92 g_free( m ); 93 } 94 g_slist_free( md->msgq ); 95 } 96 97 g_free( md ); 66 if( md->fd >= 0 ) 67 closesocket( md->fd ); 68 69 if( md->handler ) 70 { 71 if( md->handler->rxq ) g_free( md->handler->rxq ); 72 if( md->handler->cmd_text ) g_free( md->handler->cmd_text ); 73 g_free( md->handler ); 74 } 75 76 while( md->switchboards ) 77 msn_sb_destroy( md->switchboards->data ); 78 79 if( md->msgq ) 80 { 81 struct msn_message *m; 82 83 for( l = md->msgq; l; l = l->next ) 84 { 85 m = l->data; 86 87 serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who ); 88 g_free( m->who ); 89 g_free( m->text ); 90 g_free( m ); 91 } 92 g_slist_free( md->msgq ); 98 93 } 99 94 … … 105 100 g_free( l->data ); 106 101 g_slist_free( gc->deny ); 102 103 g_free( md ); 107 104 108 105 msn_connections = g_slist_remove( msn_connections, gc ); -
protocols/nogaim.c
rb72caac rdf417ca 294 294 295 295 serv_got_crap( gc, "Signing off.." ); 296 296 297 297 b_event_remove( gc->keepalive ); 298 gc->flags |= OPT_LOGGING_OUT;299 298 gc->keepalive = 0; 300 299 gc->prpl->close( gc ); -
protocols/nogaim.h
rb72caac rdf417ca 54 54 #define WEBSITE "http://www.bitlbee.org/" 55 55 #define IM_FLAG_AWAY 0x0020 56 #define OPT_CONN_HTML 0x00000001 57 #define OPT_LOGGED_IN 0x00010000 56 58 #define GAIM_AWAY_CUSTOM "Custom" 57 58 #define OPT_CONN_HTML 0x0000000159 #define OPT_LOGGED_IN 0x0001000060 #define OPT_LOGGING_OUT 0x0002000061 59 62 60 /* ok. now the fun begins. first we create a connection structure */ -
root_commands.c
rb72caac rdf417ca 163 163 164 164 case STORAGE_OK: 165 irc->status |= USTATUS_IDENTIFIED;165 irc->status = USTATUS_IDENTIFIED; 166 166 irc_umode_set( irc, "+R", 1 ); 167 167 break; … … 187 187 case STORAGE_OK: 188 188 irc_setpass( irc, NULL ); 189 irc->status &= ~USTATUS_IDENTIFIED;189 irc->status = USTATUS_LOGGED_IN; 190 190 irc_umode_set( irc, "-R", 1 ); 191 191 irc_usermsg( irc, "Account `%s' removed", irc->nick ); … … 201 201 account_t *a; 202 202 203 if( global.conf->authmode == AUTHMODE_REGISTERED && !( irc->status & USTATUS_IDENTIFIED ))203 if( global.conf->authmode == AUTHMODE_REGISTERED && irc->status < USTATUS_IDENTIFIED ) 204 204 { 205 205 irc_usermsg( irc, "This server only accepts registered users" ); -
storage_text.c
rb72caac rdf417ca 71 71 user_t *ru = user_find( irc, ROOT_NICK ); 72 72 73 if( irc->status &USTATUS_IDENTIFIED )73 if( irc->status >= USTATUS_IDENTIFIED ) 74 74 return( 1 ); 75 75 … … 88 88 /* Do this now. If the user runs with AuthMode = Registered, the 89 89 account command will not work otherwise. */ 90 irc->status |= USTATUS_IDENTIFIED;90 irc->status = USTATUS_IDENTIFIED; 91 91 92 92 while( fscanf( fp, "%511[^\n]s", s ) > 0 )
Note: See TracChangeset
for help on using the changeset viewer.