-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token-based reconnection implementation #85
base: master
Are you sure you want to change the base?
Conversation
b4a05f7
to
e334625
Compare
@Flowdalic Take a look at this :) |
Hi @ramabit. Thanks for your contribution, but I'm sorry I'm not going to review or accept a PR that is full of non semantic changes. Please fix this. |
@@ -58,8 +59,8 @@ | |||
import org.igniterealtime.jbosh.ComposableBody; | |||
|
|||
/** | |||
* Creates a connection to an XMPP server via HTTP binding. | |||
* This is specified in the XEP-0206: XMPP Over BOSH. | |||
* Creates a connection to an XMPP server via HTTP binding. This is specified in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non semantic change (of many)
@Flowdalic I understand, but the the automatic checks won't pass :/ |
I don't understand. You mean if you don't introduce non-semantic changes, then |
@Flowdalic Yes, you are right. But I can't use Command+Shift+F shortcut, and that makes not to introduce new checkstyle violations difficult and painful. But well, I will try |
Most formatters have a setting to only format your own code (i.e. the code you just added or modified). Which is what you usually always want. People, especially in FOSS projects, don't like to review commits with tons of unrelated non-semantic whitespaces changes. They just distract from the real changes. |
@Flowdalic is now ok? Should I squash the commits? |
@Flowdalic ^ I am testing a way to retrieve the refresh token :) |
6c25068
to
04b2517
Compare
@Flowdalic Fixes added and the problem retrieving the refresh token is solved |
04b2517
to
aad66a7
Compare
|
||
@Override | ||
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { | ||
xml.rightAngleBracket(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must/Should be setEmptyElement()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Flowdalic Done
d229459
to
654e627
Compare
654e627
to
0d9ede2
Compare
6f467bd
to
4a02a61
Compare
d4f74b9
to
4a02a61
Compare
Docs: http://www.xmpp.org/extensions/inbox/token-reconnection.html
Login with token:
xmppConnection.login(token, resourcepart);
Get tokens:
TBRManager tbrManager = TBRManager.getInstanceFor(xmppConnection);
TBRTokens tbrTokens = tbrManager.getTokens();
String accessToken = tbrTokens.getAccessToken();
String refreshToken = tbrTokens.getRefreshToken();
Get last refresh token obtained from "success" nonza:
String refreshToken = xmppConnection.getXOAUTHLastRefreshToken();
To avoid reconnection using token:
xmppConnection.avoidTokenReconnection();