Smack
Smack copied to clipboard
Token-based reconnection implementation
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();
@Flowdalic Take a look at this :) I have a question: how could I retrieve a refresh token from a "success" Nonza after authenticating? Because the actual Smack's authentication workflow doesn't allow me to do that I believe.
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.
@Flowdalic I understand, but the the automatic checks won't pass :/ should I ignore it?
@Flowdalic I understand, but the the automatic checks won't pass :/ should I ignore it?
I don't understand. You mean if you don't introduce non-semantic changes, then gradle check
will fail? Every commit in master
passes gradle check
. If you base your work on master
and don't introduce new checkstyle violations, then gradle check
will succeed.
@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 :)
@Flowdalic Fixes added and the problem retrieving the refresh token is solved