Merge remote-tracking branch 'origin/master'

This commit is contained in:
Artem Savkov 2018-06-02 19:18:10 +02:00
commit 98b03f4210
2 changed files with 19 additions and 0 deletions

16
README
View File

@ -61,6 +61,22 @@ Plugin adds 'discord' protocol to bitlbee, add your account as usual:
> account add discord <email> <password>
> account discord on
On your first login you might need to authorize bitlbee's ip address
(discord will send you an email with a link) or get a captcha-request. In
latter case you will have to manually set discord login-token to log in:
> account off discord
> acc discord set token_cache xxxxxxxx
To get your token you'll have to login with your browser and locate it in
"local storage"
Chrome: Developer Tools -> Application -> Local Storage -> https://discordapp.com -> token
Firefox: Web Developer -> Storage Inspector -> Local Storage -> http://discordapp.com -> token
For more info on captcha issue and any progress on making it less painful see
https://github.com/sm00th/bitlbee-discord/issues/118
You also need to configure discord channels you would like to join/autojoin. To
do that use bitlbee's 'chat list' functionality (`help chat list` and `help
chat add`):

View File

@ -276,11 +276,14 @@ static void discord_http_login_cb(struct http_request *req)
json_value *em = NULL;
json_value *email = json_o_get(js, "email");
json_value *password = json_o_get(js, "password");
json_value *captcha_key = json_o_get(js, "captcha_key");
if (email != NULL && email->type == json_array) {
em = email->u.array.values[0];
} else if (password != NULL && password->type == json_array) {
em = password->u.array.values[0];
} else if (captcha_key != NULL && captcha_key->type == json_array) {
em = captcha_key->u.array.values[0];
}
if (em != NULL && em->type == json_string) {