mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Force capability refresh on conversation load if in webrtc beta
// FREEBIE
This commit is contained in:
parent
ea0945d406
commit
53d590947e
@ -259,6 +259,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
initializeDraft();
|
||||
}
|
||||
});
|
||||
initializeBetaCalling();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -944,6 +945,38 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
return future;
|
||||
}
|
||||
|
||||
private void initializeBetaCalling() {
|
||||
if (!TextSecurePreferences.isWebrtcCallingEnabled(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
new AsyncTask<Void, Void, boolean[]>() {
|
||||
@Override
|
||||
protected boolean[] doInBackground(Void... params) {
|
||||
try {
|
||||
Context context = ConversationActivity.this;
|
||||
UserCapabilities userCapabilities = DirectoryHelper.refreshDirectoryFor(context, masterSecret, recipients,
|
||||
TextSecurePreferences.getLocalNumber(context));
|
||||
|
||||
|
||||
return new boolean[] {userCapabilities.getTextCapability() == Capability.SUPPORTED,
|
||||
userCapabilities.getVideoCapability() == Capability.SUPPORTED && !isSelfConversation(),
|
||||
Util.isDefaultSmsProvider(context)};
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(boolean[] result) {
|
||||
if (result != null && (result[0] != isSecureText || result[1] != isSecureVideo || result[2] != isDefaultSms)) {
|
||||
handleSecurityChange(result[0], result[1], result[2]);
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
private void onSecurityUpdated() {
|
||||
updateRecipientPreferences();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user