Changeset 59c9adb4 for protocols/jabber/jabber.c
- Timestamp:
- 2011-07-25T12:09:30Z (13 years ago)
- Branches:
- master
- Children:
- 4a5d885
- Parents:
- 57b4525
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r57b4525 r59c9adb4 135 135 s = strchr( acc->user, '/' ); 136 136 *s = 0; 137 }138 139 /* This code isn't really pretty. Backwards compatibility never is... */140 s = acc->server;141 while( s )142 {143 static int had_port = 0;144 145 if( strncmp( s, "ssl", 3 ) == 0 )146 {147 set_setstr( &acc->set, "ssl", "true" );148 149 /* Flush this part so that (if this was the first150 part of the server string) acc->server gets151 flushed. We don't want to have to do this another152 time. :-) */153 *s = 0;154 s ++;155 156 /* Only set this if the user didn't specify a custom157 port number already... */158 if( !had_port )159 set_setint( &acc->set, "port", 5223 );160 }161 else if( isdigit( *s ) )162 {163 int i;164 165 /* The first character is a digit. It could be an166 IP address though. Only accept this as a port#167 if there are only digits. */168 for( i = 0; isdigit( s[i] ); i ++ );169 170 /* If the first non-digit character is a colon or171 the end of the string, save the port number172 where it should be. */173 if( s[i] == ':' || s[i] == 0 )174 {175 sscanf( s, "%d", &i );176 set_setint( &acc->set, "port", i );177 178 /* See above. */179 *s = 0;180 s ++;181 }182 183 had_port = 1;184 }185 186 s = strchr( s, ':' );187 if( s )188 {189 *s = 0;190 s ++;191 }192 137 } 193 138
Note: See TracChangeset
for help on using the changeset viewer.