Skip to content

Commit

Permalink
v0.13.0 (build 184)
Browse files Browse the repository at this point in the history
  • Loading branch information
finiasz committed Oct 28, 2022
1 parent 15317ba commit c68aae8
Show file tree
Hide file tree
Showing 265 changed files with 43,656 additions and 336 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Build 184 (0.13.0)
2022-10-24

- Fix a crash

# ~~Build 183 (0.13.0)~~
2022-10-20

- make groups v2 the default for new groups
- update to webRTC 5304
- sort discussions by pinned first when appropriate (share, forward, etc.)

# Build 182 (0.12.6)
2022-09-22

- Fix for one time ephemeral and Gif keyboard
- fix for one time ephemeral and Gif keyboard

# ~~Build 181 (0.12.6)~~
2022-09-19
Expand Down
6 changes: 3 additions & 3 deletions obv_engine/engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ dependencies {
testImplementation 'org.xerial:sqlite-jdbc:3.39.3.0' // only here to check if a new version is available

implementation 'org.java-websocket:Java-WebSocket:1.5.3'
implementation 'org.slf4j:slf4j-api:2.0.1'
implementation 'org.slf4j:slf4j-simple:2.0.1'
implementation 'org.slf4j:slf4j-api:2.0.3'
implementation 'org.slf4j:slf4j-simple:2.0.3'

implementation 'org.bitbucket.b_c:jose4j:0.8.0'
implementation 'org.bitbucket.b_c:jose4j:0.9.0'

implementation 'net.iharder:base64:2.3.9'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public SpeedAndEta getSpeedAndEta() {
Sample end = samples.get(samples.size() - 1);
long elapsed = end.timestamp - start.timestamp;
long xferred = end.byteCount - start.byteCount;
if (elapsed == 0 || xferred == 0) {
return new SpeedAndEta(0, 0);
}
float speed = 1000 * (float) xferred / (float) elapsed;
int eta = Math.round((totalBytes - end.byteCount) / speed);
return new SpeedAndEta(speed, eta);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,7 @@ public enum TurnCredentialsFailedReason {

public static final String NOTIFICATION_WELL_KNOWN_DOWNLOAD_FAILED = "network_fetch_notification_well_known_download_failed";
public static final String NOTIFICATION_WELL_KNOWN_DOWNLOAD_FAILED_SERVER_KEY = "server"; // String

public static final String NOTIFICATION_PUSH_TOPIC_NOTIFIED = "network_fetch_notification_push_topic_notified";
public static final String NOTIFICATION_PUSH_TOPIC_NOTIFIED_TOPIC_KEY = "topic"; // String
}
21 changes: 6 additions & 15 deletions obv_engine/engine/src/main/java/io/olvid/engine/engine/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -895,15 +895,6 @@ public void updateOwnedIdentityPhoto(byte[] bytesOwnedIdentity, String absoluteP
}
}

@Override
public String serverForIdentity(byte[] bytesIdentity) {
try {
return Identity.of(bytesIdentity).getServer();
} catch (DecodingException e) {
return null;
}
}

@Override
public byte[] getServerAuthenticationToken(byte[] bytesOwnedIdentity) {
try {
Expand Down Expand Up @@ -1848,14 +1839,14 @@ public void pauseAttachmentDownload(byte[] bytesOwnedIdentity, byte[] messageIde
}

@Override
public void deleteAttachment(ObvAttachment attachment) {
deleteAttachment(attachment.getOwnedIdentity(), attachment.getMessageUid(), attachment.getNumber());
public void markAttachmentForDeletion(ObvAttachment attachment) {
markAttachmentForDeletion(attachment.getOwnedIdentity(), attachment.getMessageUid(), attachment.getNumber());
}

@Override
public void deleteAttachment(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber) {
public void markAttachmentForDeletion(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber) {
try {
deleteAttachment(Identity.of(bytesOwnedIdentity), new UID(messageIdentifier), attachmentNumber);
markAttachmentForDeletion(Identity.of(bytesOwnedIdentity), new UID(messageIdentifier), attachmentNumber);
} catch (DecodingException e) {
Logger.e("Error parsing bytesOwnedIdentity in Engine.deleteAttachment");
e.printStackTrace();
Expand All @@ -1882,7 +1873,7 @@ public void deleteMessageAndAttachments(byte[] bytesOwnedIdentity, byte[] messag
}

@Override
public void deleteMessage(byte[] bytesOwnedIdentity, byte[] messageIdentifier) {
public void markMessageForDeletion(byte[] bytesOwnedIdentity, byte[] messageIdentifier) {
UID messageUid = new UID(messageIdentifier);
Identity ownedIdentity;
try {
Expand All @@ -1900,7 +1891,7 @@ public void deleteMessage(byte[] bytesOwnedIdentity, byte[] messageIdentifier) {
}
}

private void deleteAttachment(Identity ownedIdentity, UID messageUid, int attachmentNumber) {
private void markAttachmentForDeletion(Identity ownedIdentity, UID messageUid, int attachmentNumber) {
try (EngineSession engineSession = getSession()) {
fetchManager.deleteAttachment(engineSession.session, ownedIdentity, messageUid, attachmentNumber);
engineSession.session.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void registerToNotifications(NotificationManager notificationManager) {
DownloadNotifications.NOTIFICATION_PING_LOST,
DownloadNotifications.NOTIFICATION_PING_RECEIVED,
DownloadNotifications.NOTIFICATION_WEBSOCKET_CONNECTION_STATE_CHANGED,
DownloadNotifications.NOTIFICATION_PUSH_TOPIC_NOTIFIED,
}) {
notificationManager.addListener(notificationName, this);
}
Expand Down Expand Up @@ -496,6 +497,17 @@ public void callback(String notificationName, HashMap<String, Object> userInfo)
engine.postEngineNotification(EngineNotifications.WEBSOCKET_CONNECTION_STATE_CHANGED, engineInfo);
break;
}
case DownloadNotifications.NOTIFICATION_PUSH_TOPIC_NOTIFIED: {
String topic = (String) userInfo.get(DownloadNotifications.NOTIFICATION_PUSH_TOPIC_NOTIFIED_TOPIC_KEY);
if (topic == null) {
break;
}
HashMap<String, Object> engineInfo = new HashMap<>();
engineInfo.put(EngineNotifications.PUSH_TOPIC_NOTIFIED_TOPIC_KEY, topic);

engine.postEngineNotification(EngineNotifications.PUSH_TOPIC_NOTIFIED, engineInfo);
break;
}
default:
Logger.w("Received notification " + notificationName + " but no handler is set.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ enum ApiKeyStatus {
void publishLatestIdentityDetails(byte[] bytesOwnedIdentity);
void updateOwnedIdentityPhoto(byte[] bytesOwnedIdentity, String absolutePhotoUrl) throws Exception;

String serverForIdentity(byte[] bytesIdentity);
byte[] getServerAuthenticationToken(byte[] bytesOwnedIdentity);

List<ObvCapability> getOwnCapabilities(byte[] bytesOwnedIdentity); // returns null in case of error, empty list if there are no capabilities
Expand Down Expand Up @@ -185,10 +184,10 @@ enum ApiKeyStatus {
void downloadSmallAttachment(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber);
void downloadLargeAttachment(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber);
void pauseAttachmentDownload(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber);
void deleteAttachment(ObvAttachment attachment);
void deleteAttachment(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber);
void markAttachmentForDeletion(ObvAttachment attachment);
void markAttachmentForDeletion(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber);
void deleteMessageAndAttachments(byte[] bytesOwnedIdentity, byte[] messageIdentifier);
void deleteMessage(byte[] bytesOwnedIdentity, byte[] messageIdentifier);
void markMessageForDeletion(byte[] bytesOwnedIdentity, byte[] messageIdentifier);
void cancelAttachmentUpload(byte[] bytesOwnedIdentity, byte[] messageIdentifier, int attachmentNumber);
void resendAllAttachmentNotifications() throws Exception;
void connectWebsocket(String os, String osVersion, int appBuild, String appVersion);
Expand All @@ -200,7 +199,7 @@ enum ApiKeyStatus {
void initiateBackup(boolean forExport);
ObvBackupKeyInformation getBackupKeyInformation() throws Exception;
void generateBackupKey();
void setAutoBackupEnabled(boolean enabled, boolean doNotInitiateBackupNow);
void setAutoBackupEnabled(boolean enabled, boolean initiateBackupNowIfNeeded);
void markBackupExported(byte[] backupKeyUid, int version);
void markBackupUploaded(byte[] backupKeyUid, int version);
void discardBackup(byte[] backupKeyUid, int version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,7 @@ public abstract class EngineNotifications {
public static final String GROUP_V2_UPDATE_FAILED_BYTES_OWNED_IDENTITY_KEY = "bytes_owned_identity"; // byte[]
public static final String GROUP_V2_UPDATE_FAILED_BYTES_GROUP_IDENTIFIER_KEY = "bytes_group_identifier"; // byte[]
public static final String GROUP_V2_UPDATE_FAILED_ERROR_KEY = "error"; // boolean

public static final String PUSH_TOPIC_NOTIFIED = "engine_notification_push_topic_notified";
public static final String PUSH_TOPIC_NOTIFIED_TOPIC_KEY = "topic"; // String
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum ObvCapability {
ONE_TO_ONE_CONTACTS,
GROUPS_V2;

public static List<ObvCapability> currentCapabilities = new ArrayList<>(Arrays.asList(
public static final List<ObvCapability> currentCapabilities = new ArrayList<>(Arrays.asList(
ONE_TO_ONE_CONTACTS,
GROUPS_V2
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;

Expand Down Expand Up @@ -1032,7 +1033,7 @@ public boolean updateKeycloakPushTopicsIfNeeded(Session session, Identity ownedI
public void setOwnedIdentityKeycloakSelfRevocationTestNonce(Session session, Identity ownedIdentity, String serverUrl, String nonce) throws SQLException {
KeycloakServer keycloakServer = KeycloakServer.get(wrapSession(session), serverUrl, ownedIdentity);

if (keycloakServer != null) {
if (keycloakServer != null && !Objects.equals(keycloakServer.getSelfRevocationTestNonce(), nonce)) {
keycloakServer.setSelfRevocationTestNonce(nonce);
session.addSessionCommitListener(backupNeededSessionCommitListener);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,7 @@ public void onMessage(String message) {
Map<String, Object> receivedMessage;
String action;
try {
receivedMessage = jsonObjectMapper.readValue(message, new TypeReference<>() {
});
receivedMessage = jsonObjectMapper.readValue(message, new TypeReference<>() {});
action = (String) receivedMessage.get("action");
} catch (Exception e) {
Logger.i("Unable to parse websocket JSON message " + message);
Expand Down Expand Up @@ -736,6 +735,24 @@ public void onMessage(String message) {
}
break;
}
case "push_topic": {
Object pushTopicObject = receivedMessage.get("topic");
if (pushTopicObject != null) {
try {
String pushTopic = (String) pushTopicObject;
if (notificationPostingDelegate != null) {
HashMap<String, Object> userInfo = new HashMap<>();
userInfo.put(DownloadNotifications.NOTIFICATION_PUSH_TOPIC_NOTIFIED_TOPIC_KEY, pushTopic);

notificationPostingDelegate.postNotification(DownloadNotifications.NOTIFICATION_PUSH_TOPIC_NOTIFIED, userInfo);
}
} catch (Exception e) {
Logger.d("Error parsing push topic");
e.printStackTrace();
}
}
break;
}
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion obv_messenger/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions obv_messenger/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c68aae8

Please sign in to comment.