set autojoin=true after following invite
This commit is contained in:
parent
b96ef1e591
commit
4df8343b05
|
@ -297,7 +297,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
if (loggedInSuccessfully) {
|
||||
if (!TextUtils.isEmpty(account.getDisplayName())) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": display name wasn't empty on first log in. publishing");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": display name wasn't empty on first log in. publishing");
|
||||
publishDisplayName(account);
|
||||
}
|
||||
}
|
||||
|
@ -526,8 +526,8 @@ public class XmppConnectionService extends Service {
|
|||
message.setCounterpart(conversation.getNextCounterpart());
|
||||
message.setType(Message.TYPE_FILE);
|
||||
}
|
||||
Log.d(Config.LOGTAG,"attachFile: type="+message.getType());
|
||||
Log.d(Config.LOGTAG,"counterpart="+message.getCounterpart());
|
||||
Log.d(Config.LOGTAG, "attachFile: type=" + message.getType());
|
||||
Log.d(Config.LOGTAG, "counterpart=" + message.getCounterpart());
|
||||
final AttachFileToConversationRunnable runnable = new AttachFileToConversationRunnable(this, uri, type, message, callback);
|
||||
if (runnable.isVideoMessage()) {
|
||||
mVideoCompressionExecutor.execute(runnable);
|
||||
|
@ -558,7 +558,7 @@ public class XmppConnectionService extends Service {
|
|||
message.setCounterpart(conversation.getNextCounterpart());
|
||||
message.setType(Message.TYPE_IMAGE);
|
||||
}
|
||||
Log.d(Config.LOGTAG,"attachImage: type="+message.getType());
|
||||
Log.d(Config.LOGTAG, "attachImage: type=" + message.getType());
|
||||
mFileAddingExecutor.execute(() -> {
|
||||
try {
|
||||
getFileBackend().copyImageToPrivateStorage(message, uri);
|
||||
|
@ -601,7 +601,7 @@ public class XmppConnectionService extends Service {
|
|||
final String action = intent == null ? null : intent.getAction();
|
||||
final boolean needsForegroundService = intent != null && intent.getBooleanExtra(EventReceiver.EXTRA_NEEDS_FOREGROUND_SERVICE, false);
|
||||
if (needsForegroundService) {
|
||||
Log.d(Config.LOGTAG,"toggle forced foreground service after receiving event (action="+action+")");
|
||||
Log.d(Config.LOGTAG, "toggle forced foreground service after receiving event (action=" + action + ")");
|
||||
toggleForegroundService(true);
|
||||
}
|
||||
String pushedAccountHash = null;
|
||||
|
@ -837,12 +837,12 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
private void checkMucStillJoined(final Account account, final String hash, final String androidId) {
|
||||
for(final Conversation conversation : this.conversations) {
|
||||
for (final Conversation conversation : this.conversations) {
|
||||
if (conversation.getAccount() == account && conversation.getMode() == Conversational.MODE_MULTI) {
|
||||
Jid jid = conversation.getJid().asBareJid();
|
||||
final String currentHash = CryptoHelper.getFingerprint(jid, androidId);
|
||||
if (currentHash.equals(hash)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received cloud push notification for MUC "+jid);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received cloud push notification for MUC " + jid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ public class XmppConnectionService extends Service {
|
|||
try {
|
||||
Security.insertProviderAt(Conscrypt.newProvider(), 1);
|
||||
} catch (Throwable throwable) {
|
||||
Log.e(Config.LOGTAG,"unable to initialize security provider", throwable);
|
||||
Log.e(Config.LOGTAG, "unable to initialize security provider", throwable);
|
||||
}
|
||||
Resolver.init(this);
|
||||
this.mRandom = new SecureRandom();
|
||||
|
@ -1137,7 +1137,7 @@ public class XmppConnectionService extends Service {
|
|||
final long start = SystemClock.elapsedRealtime();
|
||||
final List<DatabaseBackend.FilePathInfo> relativeFilePaths = databaseBackend.getFilePathInfo();
|
||||
final List<DatabaseBackend.FilePathInfo> changed = new ArrayList<>();
|
||||
for(final DatabaseBackend.FilePathInfo filePath : relativeFilePaths) {
|
||||
for (final DatabaseBackend.FilePathInfo filePath : relativeFilePaths) {
|
||||
if (destroyed) {
|
||||
Log.d(Config.LOGTAG, "Stop checking for deleted files because service has been destroyed");
|
||||
return;
|
||||
|
@ -1148,7 +1148,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
}
|
||||
final long duration = SystemClock.elapsedRealtime() - start;
|
||||
Log.d(Config.LOGTAG,"found "+changed.size()+" changed files on start up. total="+relativeFilePaths.size()+". ("+duration+"ms)");
|
||||
Log.d(Config.LOGTAG, "found " + changed.size() + " changed files on start up. total=" + relativeFilePaths.size() + ". (" + duration + "ms)");
|
||||
if (changed.size() > 0) {
|
||||
databaseBackend.markFilesAsChanged(changed);
|
||||
markChangedFiles(changed);
|
||||
|
@ -1229,7 +1229,7 @@ public class XmppConnectionService extends Service {
|
|||
if (!mForceForegroundService.get()) {
|
||||
mNotificationService.dismissForcedForegroundNotification(); //if the channel was changed the previous call might fail
|
||||
}
|
||||
Log.d(Config.LOGTAG,"ForegroundService: "+(status?"on":"off"));
|
||||
Log.d(Config.LOGTAG, "ForegroundService: " + (status ? "on" : "off"));
|
||||
}
|
||||
|
||||
public boolean foregroundNotificationNeedsUpdatingWhenErrorStateChanges() {
|
||||
|
@ -1369,7 +1369,7 @@ public class XmppConnectionService extends Service {
|
|||
if (QuickConversationsService.isQuicksy() && conversation.getMode() == Conversation.MODE_SINGLE) {
|
||||
final Contact contact = conversation.getContact();
|
||||
if (!contact.showInRoster() && contact.getOption(Contact.Options.SYNCED_VIA_OTHER)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": adding "+contact.getJid()+" on sending message");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": adding " + contact.getJid() + " on sending message");
|
||||
createContact(contact, true);
|
||||
}
|
||||
}
|
||||
|
@ -1460,7 +1460,7 @@ public class XmppConnectionService extends Service {
|
|||
message.setBody(decryptedBody);
|
||||
message.setEncryption(Message.ENCRYPTION_DECRYPTED);
|
||||
if (!databaseBackend.updateMessage(message, message.getEditedId())) {
|
||||
Log.e(Config.LOGTAG,"error updated message in DB after edit");
|
||||
Log.e(Config.LOGTAG, "error updated message in DB after edit");
|
||||
}
|
||||
updateConversationUi();
|
||||
return;
|
||||
|
@ -1500,7 +1500,7 @@ public class XmppConnectionService extends Service {
|
|||
databaseBackend.createMessage(message);
|
||||
} else if (message.edited()) {
|
||||
if (!databaseBackend.updateMessage(message, message.getEditedId())) {
|
||||
Log.e(Config.LOGTAG,"error updated message in DB after edit");
|
||||
Log.e(Config.LOGTAG, "error updated message in DB after edit");
|
||||
}
|
||||
}
|
||||
updateConversationUi();
|
||||
|
@ -1526,7 +1526,7 @@ public class XmppConnectionService extends Service {
|
|||
final boolean pending = account.pendingConferenceJoins.contains(conversation);
|
||||
final boolean inProgressJoin = inProgress || pending;
|
||||
if (inProgressJoin) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": holding back message to group. inProgress="+inProgress+", pending="+pending);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": holding back message to group. inProgress=" + inProgress + ", pending=" + pending);
|
||||
}
|
||||
return inProgressJoin;
|
||||
} else {
|
||||
|
@ -1586,7 +1586,7 @@ public class XmppConnectionService extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
public void processBookmarksInitial(Account account, Map<Jid,Bookmark> bookmarks, final boolean pep) {
|
||||
public void processBookmarksInitial(Account account, Map<Jid, Bookmark> bookmarks, final boolean pep) {
|
||||
final Set<Jid> previousBookmarks = account.getBookmarkedJids();
|
||||
final boolean synchronizeWithBookmarks = synchronizeWithBookmarks();
|
||||
for (Bookmark bookmark : bookmarks.values()) {
|
||||
|
@ -1605,7 +1605,7 @@ public class XmppConnectionService extends Service {
|
|||
public void processDeletedBookmark(Account account, Jid jid) {
|
||||
final Conversation conversation = find(account, jid);
|
||||
if (conversation != null && conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": archiving destroyed conference ("+conversation.getJid()+") after receiving pep");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": archiving destroyed conference (" + conversation.getJid() + ") after receiving pep");
|
||||
archiveConversation(conversation, false);
|
||||
}
|
||||
}
|
||||
|
@ -1619,7 +1619,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
bookmark.setConversation(conversation);
|
||||
if (pep && synchronizeWithBookmarks && !bookmark.autojoin()) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": archiving conference ("+conversation.getJid()+") after receiving pep");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": archiving conference (" + conversation.getJid() + ") after receiving pep");
|
||||
archiveConversation(conversation, false);
|
||||
} else {
|
||||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
|
@ -1627,7 +1627,7 @@ public class XmppConnectionService extends Service {
|
|||
final String current = mucOptions.getActualNick();
|
||||
final String proposed = mucOptions.getProposedNick();
|
||||
if (current != null && !current.equals(proposed)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": proposed nick changed after bookmark push "+current+"->"+proposed);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": proposed nick changed after bookmark push " + current + "->" + proposed);
|
||||
joinMuc(conversation);
|
||||
}
|
||||
}
|
||||
|
@ -1661,10 +1661,9 @@ public class XmppConnectionService extends Service {
|
|||
final XmppConnection connection = account.getXmppConnection();
|
||||
if (connection.getFeatures().bookmarksConversion()) {
|
||||
IqPacket request = mIqGenerator.deleteItem(Namespace.BOOKMARKS2, bookmark.getJid().asBareJid().toEscapedString());
|
||||
sendIqPacket(account, request, new OnIqPacketReceived() {
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
Log.d(Config.LOGTAG,packet.toString());
|
||||
sendIqPacket(account, request, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to delete bookmark " + response.getError());
|
||||
}
|
||||
});
|
||||
} else if (connection.getFeatures().bookmarksConversion()) {
|
||||
|
@ -1691,7 +1690,7 @@ public class XmppConnectionService extends Service {
|
|||
for (Bookmark bookmark : account.getBookmarks()) {
|
||||
storage.addChild(bookmark);
|
||||
}
|
||||
pushNodeAndEnforcePublishOptions(account,Namespace.BOOKMARKS,storage, PublishOptions.persistentWhitelistAccess());
|
||||
pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS, storage, PublishOptions.persistentWhitelistAccess());
|
||||
|
||||
}
|
||||
|
||||
|
@ -1720,11 +1719,11 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
@Override
|
||||
public void onPushFailed() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to push node configuration ("+node+")");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to push node configuration (" + node + ")");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": error publishing bookmarks (retry="+Boolean.toString(retry)+") "+response);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": error publishing bookmarks (retry=" + Boolean.toString(retry) + ") " + response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1771,7 +1770,7 @@ public class XmppConnectionService extends Service {
|
|||
restoreMessages(quickLoad);
|
||||
updateConversationUi();
|
||||
final long diffMessageRestore = SystemClock.elapsedRealtime() - startMessageRestore;
|
||||
Log.d(Config.LOGTAG,"quickly restored "+quickLoad.getName()+" after " + diffMessageRestore + "ms");
|
||||
Log.d(Config.LOGTAG, "quickly restored " + quickLoad.getName() + " after " + diffMessageRestore + "ms");
|
||||
}
|
||||
for (Conversation conversation : this.conversations) {
|
||||
if (quickLoad != conversation) {
|
||||
|
@ -1835,7 +1834,7 @@ public class XmppConnectionService extends Service {
|
|||
final File file = new File(path);
|
||||
final boolean isInternalFile = fileBackend.isInternalFile(file);
|
||||
final List<String> uuids = databaseBackend.markFileAsDeleted(file, isInternalFile);
|
||||
Log.d(Config.LOGTAG, "deleted file " + path+" internal="+isInternalFile+", database hits="+uuids.size());
|
||||
Log.d(Config.LOGTAG, "deleted file " + path + " internal=" + isInternalFile + ", database hits=" + uuids.size());
|
||||
markUuidsAsDeletedFiles(uuids);
|
||||
}
|
||||
|
||||
|
@ -1873,7 +1872,7 @@ public class XmppConnectionService extends Service {
|
|||
orderedUuids = null;
|
||||
} else {
|
||||
orderedUuids = new ArrayList<>();
|
||||
for(Conversation conversation : list) {
|
||||
for (Conversation conversation : list) {
|
||||
orderedUuids.add(conversation.getUuid());
|
||||
}
|
||||
}
|
||||
|
@ -2149,7 +2148,7 @@ public class XmppConnectionService extends Service {
|
|||
final int targetState = enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
|
||||
getPackageManager().setComponentEnabledSetting(name, targetState, PackageManager.DONT_KILL_APP);
|
||||
} catch (IllegalStateException e) {
|
||||
Log.d(Config.LOGTAG,"unable to toggle profile picture actvitiy");
|
||||
Log.d(Config.LOGTAG, "unable to toggle profile picture actvitiy");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2292,7 +2291,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnConversationUpdates.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as ConversationListChangedListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as ConversationListChangedListener");
|
||||
}
|
||||
this.mNotificationService.setIsInForeground(this.mOnConversationUpdates.size() > 0);
|
||||
}
|
||||
|
@ -2318,7 +2317,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnShowErrorToasts.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnShowErrorToastListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnShowErrorToastListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2342,7 +2341,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnAccountUpdates.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnAccountListChangedtListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnAccountListChangedtListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2366,7 +2365,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnCaptchaRequested.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnCaptchaRequestListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnCaptchaRequestListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2390,7 +2389,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnRosterUpdates.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnRosterUpdateListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnRosterUpdateListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2414,7 +2413,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnUpdateBlocklist.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnUpdateBlocklistListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnUpdateBlocklistListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2438,7 +2437,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnKeyStatusUpdated.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnKeyStatusUpdateListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnKeyStatusUpdateListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2462,7 +2461,7 @@ public class XmppConnectionService extends Service {
|
|||
synchronized (LISTENER_LOCK) {
|
||||
remainingListeners = checkListeners();
|
||||
if (!this.mOnMucRosterUpdate.add(listener)) {
|
||||
Log.w(Config.LOGTAG,listener.getClass().getName()+" is already registered as OnMucRosterListener");
|
||||
Log.w(Config.LOGTAG, listener.getClass().getName() + " is already registered as OnMucRosterListener");
|
||||
}
|
||||
}
|
||||
if (remainingListeners) {
|
||||
|
@ -2562,7 +2561,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
synchronized (account.inProgressConferencePings) {
|
||||
if (!account.inProgressConferencePings.add(conversation)) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid()+": canceling muc self ping because ping is already under way");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": canceling muc self ping because ping is already under way");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2574,13 +2573,13 @@ public class XmppConnectionService extends Service {
|
|||
if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Element error = response.findChild("error");
|
||||
if (error == null || error.hasChild("service-unavailable") || error.hasChild("feature-not-implemented") || error.hasChild("item-not-found")) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": ping to "+self+" came back as ignorable error");
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": ping to " + self + " came back as ignorable error");
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": ping to "+self+" failed. attempting rejoin");
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": ping to " + self + " failed. attempting rejoin");
|
||||
joinMuc(conversation);
|
||||
}
|
||||
} else if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": ping to "+self+" came back fine");
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": ping to " + self + " came back fine");
|
||||
}
|
||||
synchronized (account.inProgressConferencePings) {
|
||||
account.inProgressConferencePings.remove(conversation);
|
||||
|
@ -2668,10 +2667,19 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
if (mucOptions.isPrivateAndNonAnonymous()) {
|
||||
fetchConferenceMembers(conversation);
|
||||
if (followedInvite && conversation.getBookmark() == null) {
|
||||
|
||||
if (followedInvite) {
|
||||
final Bookmark bookmark = conversation.getBookmark();
|
||||
if (bookmark != null) {
|
||||
if (!bookmark.autojoin()) {
|
||||
bookmark.setAutojoin(true);
|
||||
createBookmark(account, bookmark);
|
||||
}
|
||||
} else {
|
||||
saveConversationAsBookmark(conversation, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mucOptions.push()) {
|
||||
enableMucPush(conversation);
|
||||
}
|
||||
|
@ -2684,7 +2692,7 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onConferenceConfigurationFetched(Conversation conversation) {
|
||||
if (conversation.getStatus() == Conversation.STATUS_ARCHIVED) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": conversation ("+conversation.getJid()+") got archived before IQ result");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": conversation (" + conversation.getJid() + ") got archived before IQ result");
|
||||
return;
|
||||
}
|
||||
join(conversation);
|
||||
|
@ -2693,7 +2701,7 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onFetchFailed(final Conversation conversation, Element error) {
|
||||
if (conversation.getStatus() == Conversation.STATUS_ARCHIVED) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": conversation ("+conversation.getJid()+") got archived before IQ result");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": conversation (" + conversation.getJid() + ") got archived before IQ result");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -2727,9 +2735,9 @@ public class XmppConnectionService extends Service {
|
|||
enable.setTo(room);
|
||||
sendIqPacket(account, enable, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": enabled direct push for muc "+room);
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": enabled direct push for muc " + room);
|
||||
} else if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": unable to enable direct push for muc "+room+" "+response.getError());
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to enable direct push for muc " + room + " " + response.getError());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2746,9 +2754,9 @@ public class XmppConnectionService extends Service {
|
|||
disable.setTo(room);
|
||||
sendIqPacket(account, disable, (a, response) -> {
|
||||
if (response.getType() == IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": disabled direct push for muc "+room);
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": disabled direct push for muc " + room);
|
||||
} else if (response.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG,a.getJid().asBareJid()+": unable to disable direct push for muc "+room+" "+response.getError());
|
||||
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to disable direct push for muc " + room + " " + response.getError());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2851,7 +2859,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void getAttachments(final Account account, final Jid jid, final int limit, final OnMediaLoaded onMediaLoaded) {
|
||||
getAttachments(account.getUuid(),jid.asBareJid(),limit, onMediaLoaded);
|
||||
getAttachments(account.getUuid(), jid.asBareJid(), limit, onMediaLoaded);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2875,7 +2883,7 @@ public class XmppConnectionService extends Service {
|
|||
final Account account = conversation.getAccount();
|
||||
final String defaultNick = MucOptions.defaultNick(account);
|
||||
if (TextUtils.isEmpty(bookmarkedNick) && full.getResource().equals(defaultNick)) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": do not overwrite empty bookmark nick with default nick for "+conversation.getJid().asBareJid());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": do not overwrite empty bookmark nick with default nick for " + conversation.getJid().asBareJid());
|
||||
return;
|
||||
}
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": persist nick '" + full.getResource() + "' into bookmark for " + conversation.getJid().asBareJid());
|
||||
|
@ -3024,9 +3032,9 @@ public class XmppConnectionService extends Service {
|
|||
for (Jid invite : jids) {
|
||||
invite(conversation, invite);
|
||||
}
|
||||
for(String resource : account.getSelfContact().getPresences().toResourceArray()) {
|
||||
for (String resource : account.getSelfContact().getPresences().toResourceArray()) {
|
||||
Jid other = account.getJid().withResource(resource);
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": sending direct invite to "+other);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": sending direct invite to " + other);
|
||||
directInvite(conversation, other);
|
||||
}
|
||||
saveConversationAsBookmark(conversation, name);
|
||||
|
@ -3095,7 +3103,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
updateConversationUi();
|
||||
} else if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received timeout waiting for conference configuration fetch");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received timeout waiting for conference configuration fetch");
|
||||
} else {
|
||||
if (callback != null) {
|
||||
callback.onFetchFailed(conversation, packet.getError());
|
||||
|
@ -3110,7 +3118,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void pushNodeConfiguration(Account account, final Jid jid, final String node, final Bundle options, final OnConfigurationPushed callback) {
|
||||
Log.d(Config.LOGTAG,"pushing node configuration");
|
||||
Log.d(Config.LOGTAG, "pushing node configuration");
|
||||
sendIqPacket(account, mIqGenerator.requestPubsubConfiguration(jid, node), new OnIqPacketReceived() {
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
|
@ -3125,7 +3133,7 @@ public class XmppConnectionService extends Service {
|
|||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket packet) {
|
||||
if (packet.getType() == IqPacket.TYPE.RESULT && callback != null) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": successfully changed node configuration for node "+node);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": successfully changed node configuration for node " + node);
|
||||
callback.onPushSucceeded();
|
||||
} else if (packet.getType() == IqPacket.TYPE.ERROR && callback != null) {
|
||||
callback.onPushFailed();
|
||||
|
@ -3143,8 +3151,8 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void pushConferenceConfiguration(final Conversation conversation, final Bundle options, final OnConfigurationPushed callback) {
|
||||
if (options.getString("muc#roomconfig_whois","moderators").equals("anyone")) {
|
||||
conversation.setAttribute("accept_non_anonymous",true);
|
||||
if (options.getString("muc#roomconfig_whois", "moderators").equals("anyone")) {
|
||||
conversation.setAttribute("accept_non_anonymous", true);
|
||||
updateConversation(conversation);
|
||||
}
|
||||
IqPacket request = new IqPacket(IqPacket.TYPE.GET);
|
||||
|
@ -3218,7 +3226,7 @@ public class XmppConnectionService extends Service {
|
|||
Log.d(Config.LOGTAG, request.toString());
|
||||
sendIqPacket(conference.getAccount(), request, (account, packet) -> {
|
||||
if (packet.getType() != IqPacket.TYPE.RESULT) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+" unable to change role of "+nick);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + " unable to change role of " + nick);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -3278,7 +3286,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
public void updateMessage(Message message, String uuid) {
|
||||
if (!databaseBackend.updateMessage(message, uuid)) {
|
||||
Log.e(Config.LOGTAG,"error updated message in DB after edit");
|
||||
Log.e(Config.LOGTAG, "error updated message in DB after edit");
|
||||
}
|
||||
updateConversationUi();
|
||||
}
|
||||
|
@ -3350,7 +3358,7 @@ public class XmppConnectionService extends Service {
|
|||
final Avatar avatar = getFileBackend().getPepAvatar(image, size, format);
|
||||
if (avatar != null) {
|
||||
if (!getFileBackend().save(avatar)) {
|
||||
Log.d(Config.LOGTAG,"unable to save vcard");
|
||||
Log.d(Config.LOGTAG, "unable to save vcard");
|
||||
callback.onAvatarPublicationFailed(R.string.error_saving_avatar);
|
||||
return;
|
||||
}
|
||||
|
@ -3407,25 +3415,25 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public void publishAvatar(Account account, final Avatar avatar, final Bundle options, final boolean retry, final OnAvatarPublication callback) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": publishing avatar. options="+options);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": publishing avatar. options=" + options);
|
||||
IqPacket packet = this.mIqGenerator.publishAvatar(avatar, options);
|
||||
this.sendIqPacket(account, packet, new OnIqPacketReceived() {
|
||||
|
||||
@Override
|
||||
public void onIqPacketReceived(Account account, IqPacket result) {
|
||||
if (result.getType() == IqPacket.TYPE.RESULT) {
|
||||
publishAvatarMetadata(account, avatar, options,true, callback);
|
||||
publishAvatarMetadata(account, avatar, options, true, callback);
|
||||
} else if (retry && PublishOptions.preconditionNotMet(result)) {
|
||||
pushNodeConfiguration(account, "urn:xmpp:avatar:data", options, new OnConfigurationPushed() {
|
||||
@Override
|
||||
public void onPushSucceeded() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": changed node configuration for avatar node");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": changed node configuration for avatar node");
|
||||
publishAvatar(account, avatar, options, false, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPushFailed() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to change node configuration for avatar node");
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to change node configuration for avatar node");
|
||||
publishAvatar(account, avatar, null, false, callback);
|
||||
}
|
||||
});
|
||||
|
@ -3459,14 +3467,14 @@ public class XmppConnectionService extends Service {
|
|||
pushNodeConfiguration(account, "urn:xmpp:avatar:metadata", options, new OnConfigurationPushed() {
|
||||
@Override
|
||||
public void onPushSucceeded() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": changed node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, options,false, callback);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": changed node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, options, false, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPushFailed() {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to change node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, null,false, callback);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to change node configuration for avatar meta data node");
|
||||
publishAvatarMetadata(account, avatar, null, false, callback);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -3543,7 +3551,7 @@ public class XmppConnectionService extends Service {
|
|||
} else if (avatar.origin == Avatar.Origin.PEP) {
|
||||
mOmittedPepAvatarFetches.add(KEY);
|
||||
} else {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": already fetching "+avatar.origin+" avatar for "+avatar.owner);
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": already fetching " + avatar.origin + " avatar for " + avatar.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3620,7 +3628,7 @@ public class XmppConnectionService extends Service {
|
|||
avatar.image = image;
|
||||
if (getFileBackend().save(avatar)) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid()
|
||||
+ ": successfully fetched vCard avatar for " + avatar.owner+" omittedPep="+previouslyOmittedPepFetch);
|
||||
+ ": successfully fetched vCard avatar for " + avatar.owner + " omittedPep=" + previouslyOmittedPepFetch);
|
||||
if (avatar.owner.isBareJid()) {
|
||||
if (account.getJid().asBareJid().equals(avatar.owner) && account.getAvatar() == null) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": had no avatar. replacing with vcard");
|
||||
|
@ -3701,8 +3709,8 @@ public class XmppConnectionService extends Service {
|
|||
public void notifyAccountAvatarHasChanged(final Account account) {
|
||||
final XmppConnection connection = account.getXmppConnection();
|
||||
if (connection != null && connection.getFeatures().bookmarksConversion()) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": avatar changed. resending presence to online group chats");
|
||||
for(Conversation conversation : conversations) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": avatar changed. resending presence to online group chats");
|
||||
for (Conversation conversation : conversations) {
|
||||
if (conversation.getAccount() == account && conversation.getMode() == Conversational.MODE_MULTI) {
|
||||
final MucOptions mucOptions = conversation.getMucOptions();
|
||||
if (mucOptions.online()) {
|
||||
|
@ -3979,7 +3987,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
|
||||
public Account findAccountByUuid(final String uuid) {
|
||||
for(Account account : this.accounts) {
|
||||
for (Account account : this.accounts) {
|
||||
if (account.getUuid().equals(uuid)) {
|
||||
return account;
|
||||
}
|
||||
|
@ -4162,7 +4170,7 @@ public class XmppConnectionService extends Service {
|
|||
if (connection != null) {
|
||||
connection.sendIqPacket(packet, callback);
|
||||
} else if (callback != null) {
|
||||
callback.onIqPacketReceived(account,new IqPacket(IqPacket.TYPE.TIMEOUT));
|
||||
callback.onIqPacketReceived(account, new IqPacket(IqPacket.TYPE.TIMEOUT));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4386,7 +4394,7 @@ public class XmppConnectionService extends Service {
|
|||
mAvatarService.clear(account);
|
||||
sendIqPacket(account, request, (account1, packet) -> {
|
||||
if (packet.getType() == IqPacket.TYPE.ERROR) {
|
||||
Log.d(Config.LOGTAG, account1.getJid().asBareJid() + ": unable to modify nick name "+packet.toString());
|
||||
Log.d(Config.LOGTAG, account1.getJid().asBareJid() + ": unable to modify nick name " + packet.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4418,7 +4426,7 @@ public class XmppConnectionService extends Service {
|
|||
final String ver = presence.getVer();
|
||||
final Element query = request.query("http://jabber.org/protocol/disco#info");
|
||||
if (node != null && ver != null) {
|
||||
query.setAttribute("node",node+"#"+ver);
|
||||
query.setAttribute("node", node + "#" + ver);
|
||||
}
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": making disco request for " + key.second + " to " + jid);
|
||||
sendIqPacket(account, request, (a, response) -> {
|
||||
|
@ -4643,7 +4651,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
onStartCommand(intent,0,0);
|
||||
onStartCommand(intent, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,13 +225,13 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
|
|||
final Conversation conversation = xmppConnectionService.findOrCreateConversation(account, result.getRoom(), true, true, true);
|
||||
Bookmark bookmark = conversation.getBookmark();
|
||||
if (bookmark != null) {
|
||||
if (!bookmark.autojoin() && syncAutojoin) {
|
||||
conversation.getBookmark().setAutojoin(true);
|
||||
if (!bookmark.autojoin() && syncAutoJoin) {
|
||||
bookmark.setAutojoin(true);
|
||||
xmppConnectionService.createBookmark(account, bookmark);
|
||||
}
|
||||
} else {
|
||||
bookmark = new Bookmark(account, conversation.getJid().asBareJid());
|
||||
bookmark.setAutojoin(syncAutojoin);
|
||||
bookmark.setAutojoin(syncAutoJoin);
|
||||
xmppConnectionService.createBookmark(account, bookmark);
|
||||
}
|
||||
switchToConversation(conversation);
|
||||
|
|
|
@ -1880,7 +1880,7 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
|
||||
public boolean bookmarks2() {
|
||||
return Config.USE_BOOKMARKS2 || hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT);
|
||||
return Config.USE_BOOKMARKS2 /* || hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT)*/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue