Changeset ce199b7
- Timestamp:
- 2011-12-21T11:21:04Z (13 years ago)
- Branches:
- master
- Children:
- 0dd6570
- Parents:
- e14b47b8
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
re14b47b8 rce199b7 61 61 s = set_add( &acc->set, "activity_timeout", "600", set_eval_int, acc ); 62 62 63 s = set_add( &acc->set, "oauth", "false", set_eval_ bool, acc );63 s = set_add( &acc->set, "oauth", "false", set_eval_oauth, acc ); 64 64 65 65 g_snprintf( str, sizeof( str ), "%d", jabber_port_list[0] ); … … 76 76 s = set_add( &acc->set, "resource_select", "activity", NULL, acc ); 77 77 78 s = set_add( &acc->set, "sasl", "true", set_eval_bool, acc ); 79 s->flags |= ACC_SET_OFFLINE_ONLY | SET_HIDDEN_DEFAULT; 80 78 81 s = set_add( &acc->set, "server", NULL, set_eval_account, acc ); 79 82 s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK; … … 84 87 s = set_add( &acc->set, "tls", "try", set_eval_tls, acc ); 85 88 s->flags |= ACC_SET_OFFLINE_ONLY; 86 87 s = set_add( &acc->set, "sasl", "true", set_eval_bool, acc );88 s->flags |= ACC_SET_OFFLINE_ONLY | SET_HIDDEN_DEFAULT;89 89 90 90 s = set_add( &acc->set, "user_agent", "BitlBee", NULL, acc ); -
protocols/twitter/twitter.c
re14b47b8 rce199b7 240 240 s->flags |= ACC_SET_OFFLINE_ONLY; 241 241 242 s = set_add(&acc->set, "oauth", def_oauth, set_eval_oauth, acc); 243 242 244 s = set_add(&acc->set, "show_ids", "false", set_eval_bool, acc); 243 245 s->flags |= ACC_SET_OFFLINE_ONLY; 244 246 245 247 s = set_add(&acc->set, "show_old_mentions", "true", set_eval_bool, acc); 246 247 s = set_add(&acc->set, "oauth", def_oauth, set_eval_bool, acc);248 248 } 249 249 -
root_commands.c
re14b47b8 rce199b7 443 443 } 444 444 445 irc_rootmsg( irc, "Account successfully added with tag %s%s", 446 a->tag, cmd[4] ? "" : 447 ", now use /OPER to enter the password" ); 445 irc_rootmsg( irc, "Account successfully added with tag %s", a->tag ); 446 447 if( cmd[4] == NULL ) 448 { 449 set_t *oauth = set_find( &a->set, "oauth" ); 450 if( oauth && bool2int( set_value( oauth ) ) ) 451 { 452 *a->pass = '\0'; 453 irc_rootmsg( irc, "No need to enter a password for this " 454 "account since it's using OAuth" ); 455 } 456 else 457 { 458 irc_rootmsg( irc, "You can now use the /OPER command to " 459 "enter the password" ); 460 if( oauth ) 461 irc_rootmsg( irc, "Alternatively, enable oauth if " 462 "the account supports it: account %s " 463 "set oauth on", a->tag ); 464 } 465 } 448 466 449 467 return; -
set.c
re14b47b8 rce199b7 85 85 return NULL; 86 86 87 return s ->value ? s->value : s->def;87 return set_value( s ); 88 88 } 89 89 … … 250 250 } 251 251 252 /* 253 char *set_eval_ops( set_t *set, char *value ) 254 { 255 irc_t *irc = set->data; 256 257 if( g_strcasecmp( value, "user" ) == 0 ) 258 irc_write( irc, ":%s!%s@%s MODE %s %s %s %s", irc->mynick, irc->mynick, irc->myhost, 259 irc->channel, "+o-o", irc->nick, irc->mynick ); 260 else if( g_strcasecmp( value, "root" ) == 0 ) 261 irc_write( irc, ":%s!%s@%s MODE %s %s %s %s", irc->mynick, irc->mynick, irc->myhost, 262 irc->channel, "-o+o", irc->nick, irc->mynick ); 263 else if( g_strcasecmp( value, "both" ) == 0 ) 264 irc_write( irc, ":%s!%s@%s MODE %s %s %s %s", irc->mynick, irc->mynick, irc->myhost, 265 irc->channel, "+oo", irc->nick, irc->mynick ); 266 else if( g_strcasecmp( value, "none" ) == 0 ) 267 irc_write( irc, ":%s!%s@%s MODE %s %s %s %s", irc->mynick, irc->mynick, irc->myhost, 268 irc->channel, "-oo", irc->nick, irc->mynick ); 269 else 270 return SET_INVALID; 271 272 return value; 273 } 274 */ 252 char *set_eval_oauth( set_t *set, char *value ) 253 { 254 account_t *acc = set->data; 255 256 if( bool2int( value ) && strcmp( acc->pass, PASSWORD_PENDING ) == 0 ) 257 *acc->pass = '\0'; 258 259 return set_eval_bool( set, value ); 260 } -
set.h
re14b47b8 rce199b7 77 77 } set_t; 78 78 79 #define set_value( set ) ((set)->value) ? ((set)->value) : ((set)->def) 80 79 81 /* Should be pretty clear. */ 80 82 set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data ); … … 111 113 /* Some not very generic evaluators that really shouldn't be here... */ 112 114 char *set_eval_to_char( set_t *set, char *value ); 113 char *set_eval_o ps( set_t *set, char *value );115 char *set_eval_oauth( set_t *set, char *value ); 114 116 115 117 #endif /* __SET_H__ */
Note: See TracChangeset
for help on using the changeset viewer.