Skip to content

Commit

Permalink
v3.3.1 (build 256)
Browse files Browse the repository at this point in the history
  • Loading branch information
finiasz committed Nov 16, 2024
1 parent 983969d commit 2cd8881
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 149 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Build 256 (3.3.1)
2024-11-16

- Fix an issue with notification channels not found after a device-wide "reset app preferences"

# Build 255 (3.3)
2024-11-14

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,13 @@ public void deleteOwnedIdentityFromInboxOutboxProtocolsAndDialogs(Session sessio
fetchManager.deleteOwnedIdentity(session, ownedIdentity, excludedProtocolInstanceUid != null);

for (UserInterfaceDialog userInterfaceDialog : UserInterfaceDialog.getAll(wrapSession(session))) {
ObvDialog obvDialog = userInterfaceDialog.getObvDialog();
if (Arrays.equals(obvDialog.getBytesOwnedIdentity(), ownedIdentity.getBytes())) {
userInterfaceDialog.delete();
try {
ObvDialog obvDialog = userInterfaceDialog.getObvDialog();
if (Arrays.equals(obvDialog.getBytesOwnedIdentity(), ownedIdentity.getBytes())) {
userInterfaceDialog.delete();
}
} catch (Exception e) {
Logger.x(e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ public void setTransferSasAndDeviceUid(String sas, byte[] deviceUidToKeepActive)


public static class Category {
public static final int INVITE_SENT_DIALOG_CATEGORY = 0;
public static final int ACCEPT_INVITE_DIALOG_CATEGORY = 1;
public static final int SAS_EXCHANGE_DIALOG_CATEGORY = 2;
public static final int SAS_CONFIRMED_DIALOG_CATEGORY = 3;
public static final int INVITE_SENT_DIALOG_CATEGORY = 0; // not found!
public static final int ACCEPT_INVITE_DIALOG_CATEGORY = 1; //
public static final int SAS_EXCHANGE_DIALOG_CATEGORY = 2; //
public static final int SAS_CONFIRMED_DIALOG_CATEGORY = 3; //
//public static final int MUTUAL_TRUST_CONFIRMED_DIALOG_CATEGORY = 4;
public static final int INVITE_ACCEPTED_DIALOG_CATEGORY = 5;
public static final int INVITE_ACCEPTED_DIALOG_CATEGORY = 5; // not found
public static final int ACCEPT_MEDIATOR_INVITE_DIALOG_CATEGORY = 6;
public static final int MEDIATOR_INVITE_ACCEPTED_DIALOG_CATEGORY = 7;
public static final int ACCEPT_GROUP_INVITE_DIALOG_CATEGORY = 8;
Expand Down Expand Up @@ -305,14 +305,13 @@ private static Category of(Encoded encoded, ObjectMapper jsonObjectMapper) throw

Encoded[] vars = list[1].decodeList();
switch (id) {
case SAS_CONFIRMED_DIALOG_CATEGORY: {
if (vars.length != 4) {
case ACCEPT_INVITE_DIALOG_CATEGORY: {
if (vars.length != 3) {
throw new DecodingException();
}
bytesContactIdentity = vars[0].decodeBytes();
contactDisplayNameOrSerializedDetails = vars[1].decodeString();
sasToDisplay = vars[2].decodeBytes();
sasEntered = vars[3].decodeBytes();
serverTimestamp = vars[2].decodeLong();
break;
}
case SAS_EXCHANGE_DIALOG_CATEGORY: {
Expand All @@ -325,6 +324,16 @@ private static Category of(Encoded encoded, ObjectMapper jsonObjectMapper) throw
serverTimestamp = vars[3].decodeLong();
break;
}
case SAS_CONFIRMED_DIALOG_CATEGORY: {
if (vars.length != 4) {
throw new DecodingException();
}
bytesContactIdentity = vars[0].decodeBytes();
contactDisplayNameOrSerializedDetails = vars[1].decodeString();
sasToDisplay = vars[2].decodeBytes();
sasEntered = vars[3].decodeBytes();
break;
}
case ACCEPT_MEDIATOR_INVITE_DIALOG_CATEGORY:
{
if (vars.length != 4) {
Expand Down Expand Up @@ -362,15 +371,6 @@ private static Category of(Encoded encoded, ObjectMapper jsonObjectMapper) throw
serverTimestamp = vars[4].decodeLong();
break;
}
case ACCEPT_INVITE_DIALOG_CATEGORY: {
if (vars.length != 3) {
throw new DecodingException();
}
bytesContactIdentity = vars[0].decodeBytes();
contactDisplayNameOrSerializedDetails = vars[1].decodeString();
serverTimestamp = vars[2].decodeLong();
break;
}
case ONE_TO_ONE_INVITATION_SENT_DIALOG_CATEGORY: {
if (vars.length != 1) {
throw new DecodingException();
Expand Down Expand Up @@ -409,13 +409,19 @@ private static Category of(Encoded encoded, ObjectMapper jsonObjectMapper) throw
obvTransferStep = ObvTransferStep.of(vars[0]);
break;
}
default:
case INVITE_SENT_DIALOG_CATEGORY:
case INVITE_ACCEPTED_DIALOG_CATEGORY: {
if (vars.length != 2) {
throw new DecodingException();
}
bytesContactIdentity = vars[0].decodeBytes();
contactDisplayNameOrSerializedDetails = vars[1].decodeString();
break;
}
default: {
Logger.w("Found an UI dialog with unknown category");
throw new Exception();
}
}
return new Category(id, bytesContactIdentity, contactDisplayNameOrSerializedDetails, sasToDisplay, sasEntered, bytesMediatorOrGroupOwnerIdentity, serializedGroupDetails, bytesGroupUid, pendingGroupMemberIdentities, serverTimestamp, obvGroupV2, obvSyncAtom, obvTransferStep);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public void deleteMessageAndAttachments(Session session, Identity ownedIdentity,
for (InboxAttachment inboxAttachment: inboxMessage.getAttachments()) {
inboxAttachment.markForDeletion();
}
fetchManagerSession.markAsListedAndDeleteOnServerListener.messageCanBeDeletedFromServer(ownedIdentity, messageUid);
session.addSessionCommitListener(() -> fetchManagerSession.markAsListedAndDeleteOnServerListener.messageCanBeDeletedFromServer(ownedIdentity, messageUid));
}

// This method marks a message for deletion and queues the operation to delete it from server
Expand All @@ -559,7 +559,7 @@ public void deleteMessage(Session session, Identity ownedIdentity, UID messageUi
}
inboxMessage.markForDeletion();
if (inboxMessage.canBeDeleted()) {
fetchManagerSession.markAsListedAndDeleteOnServerListener.messageCanBeDeletedFromServer(ownedIdentity, messageUid);
session.addSessionCommitListener(() -> fetchManagerSession.markAsListedAndDeleteOnServerListener.messageCanBeDeletedFromServer(ownedIdentity, messageUid));
}
}

Expand Down
4 changes: 2 additions & 2 deletions obv_messenger/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId "io.olvid.messenger"
minSdkVersion 21
targetSdk 34
versionCode 255
versionName "3.3"
versionCode 256
versionName "3.3.1"
vectorDrawables.useSupportLibrary true
multiDexEnabled true
resourceConfigurations += ['en', 'fr']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ public void onChanged(OwnedIdentity ownedIdentity) {

new Handler(Looper.getMainLooper()).post(() -> currentIdentityLiveData.observeForever(currentIdentityObserverForNameCache));

// Always re-create all channels in case a user has reset all app preferences as this deletes all notification channels
AndroidNotificationManager.createChannels(lastBuildExecuted);

if (lastBuildExecuted != BuildConfig.VERSION_CODE || lastAndroidSdkVersionExecuted != Build.VERSION.SDK_INT) {
App.runThread(() -> {
AndroidNotificationManager.createChannels(lastBuildExecuted);
runBuildUpgrade(lastBuildExecuted, lastAndroidSdkVersionExecuted);
});
}
Expand Down
Loading

0 comments on commit 2cd8881

Please sign in to comment.