Changeset 9f03c47 for root_commands.c


Ignore:
Timestamp:
2016-11-14T00:37:14Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
537d9b9, b4f496e
Parents:
ea90275
Message:

Improve support for protocols which don't require a password

This adds a prpl_options_t enum with flags, which mostly just brings
OPT_PROTO_{NO_PASSWORD,PASSWORD_OPTIONAL} from libpurple as
PRPL_OPT_{NO_PASSWORD,PASSWORD_OPTIONAL}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    rea90275 r9f03c47  
    470470                                irc_rootmsg(irc, "No need to enter a password for this "
    471471                                            "account since it's using OAuth");
     472                        } else if (prpl->options & PRPL_OPT_NO_PASSWORD) {
     473                                *a->pass = '\0';
     474                        } else if (prpl->options & PRPL_OPT_PASSWORD_OPTIONAL) {
     475                                *a->pass = '\0';
     476                                irc_rootmsg(irc, "Passwords are optional for this account. "
     477                                            "If you wish to enter the password with /OPER, do "
     478                                            "account %s set -del password", a->tag);
    472479                        } else {
    473480                                irc_rootmsg(irc, "You can now use the /OPER command to "
     
    479486                                }
    480487                        }
     488                } else if (prpl->options & PRPL_OPT_NO_PASSWORD) {
     489                        irc_rootmsg(irc, "Note: this account doesn't use password for login");
    481490                }
    482491
Note: See TracChangeset for help on using the changeset viewer.