From 22f3aac46506b28098b59a4dacdafc4ff0933ccf Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 18 May 2020 11:48:24 +0200 Subject: [PATCH] fix media browser for escapbed jids --- .../eu/siacs/conversations/persistance/DatabaseBackend.java | 2 +- .../java/eu/siacs/conversations/ui/MediaBrowserActivity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 8c021ff30..86662f530 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -854,7 +854,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { public List getRelativeFilePaths(String account, Jid jid, int limit) { SQLiteDatabase db = this.getReadableDatabase(); final String SQL = "select uuid,relativeFilePath from messages where type in (1,2,5) and deleted=0 and "+Message.RELATIVE_FILE_PATH+" is not null and conversationUuid=(select uuid from conversations where accountUuid=? and (contactJid=? or contactJid like ?)) order by timeSent desc"; - final String[] args = {account, jid.toEscapedString(), jid.toEscapedString() + "/%"}; + final String[] args = {account, jid.toString(), jid.toString() + "/%"}; Cursor cursor = db.rawQuery(SQL + (limit > 0 ? " limit " + String.valueOf(limit) : ""), args); List filesPaths = new ArrayList<>(); while (cursor.moveToNext()) { diff --git a/src/main/java/eu/siacs/conversations/ui/MediaBrowserActivity.java b/src/main/java/eu/siacs/conversations/ui/MediaBrowserActivity.java index 3cb695334..ba5102886 100644 --- a/src/main/java/eu/siacs/conversations/ui/MediaBrowserActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/MediaBrowserActivity.java @@ -49,7 +49,7 @@ public class MediaBrowserActivity extends XmppActivity implements OnMediaLoaded String account = intent == null ? null : intent.getStringExtra("account"); String jid = intent == null ? null : intent.getStringExtra("jid"); if (account != null && jid != null) { - xmppConnectionService.getAttachments(account, Jid.of(jid), 0, this); + xmppConnectionService.getAttachments(account, Jid.ofEscaped(jid), 0, this); } }