summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-10-24 15:35:24 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-10-24 15:35:24 -0500
commitad7a1854174e7888b44060c359e76051bfd82052 (patch)
treea186388030a4fc4971f6b27367d27856b2135bda /res
parentda359db93d3ba61ed0a2bff1b7645832d54f573d (diff)
parent0efeb7885a080c92699d6d794c993d2f56e6e55a (diff)
Merge "res_xmpp: Ensure the connection filter is available." into 15
Diffstat (limited to 'res')
-rw-r--r--res/res_xmpp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index 444eacbe9..8a06a6c35 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -3652,13 +3652,6 @@ static int xmpp_client_reconnect(struct ast_xmpp_client *client)
return -1;
}
- if (!ast_strlen_zero(clientcfg->refresh_token)) {
- ast_debug(2, "Obtaining OAuth access token for client '%s'\n", client->name);
- if (fetch_access_token(clientcfg)) {
- return -1;
- }
- }
-
ast_xmpp_client_disconnect(client);
client->timeout = 50;
@@ -3669,6 +3662,13 @@ static int xmpp_client_reconnect(struct ast_xmpp_client *client)
return -1;
}
+ if (!ast_strlen_zero(clientcfg->refresh_token)) {
+ ast_debug(2, "Obtaining OAuth access token for client '%s'\n", client->name);
+ if (fetch_access_token(clientcfg)) {
+ return -1;
+ }
+ }
+
/* If it's a component connect to user otherwise connect to server */
res = iks_connect_via(client->parser, S_OR(clientcfg->server, client->jid->server), clientcfg->port,
ast_test_flag(&clientcfg->flags, XMPP_COMPONENT) ? clientcfg->user : client->jid->server);