fix media browser for escapbed jids

This commit is contained in:
Daniel Gultsch 2020-05-18 11:48:24 +02:00
parent 3ca10b8fa9
commit 22f3aac465
2 changed files with 2 additions and 2 deletions

View file

@ -854,7 +854,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
public List<FilePath> 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<FilePath> filesPaths = new ArrayList<>();
while (cursor.moveToNext()) {

View file

@ -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);
}
}