Skip to content

Commit

Permalink
Fix read receipts timestamp cast during sync
Browse files Browse the repository at this point in the history
  • Loading branch information
achrafamil committed Apr 28, 2020
1 parent d8d52ac commit e9e4a35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions matrix-sdk/src/main/java/org/matrix/androidsdk/data/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,13 @@ private List<String> handleReceiptEvent(Event event) {

for (String paramName : paramsDict.keySet()) {
if (TextUtils.equals("ts", paramName)) {
Double value = (Double) paramsDict.get(paramName);
long ts = value.longValue();
Object value = paramsDict.get(paramName);
long ts;
if (value instanceof Long) {
ts = ((Long) value);
} else {
ts = ((Double) value).longValue();
}

if (handleReceiptData(new ReceiptData(userID, eventId, ts))) {
senderIDs.add(userID);
Expand Down

0 comments on commit e9e4a35

Please sign in to comment.