~singpolyma/cheogram-android

e8e3c7f4c80dbefa48190098a94b63fa0332349d — Stephen Paul Weber 3 months ago fba83e5
Don't update url unless we have a reason to
M src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java => src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +5 -3
@@ 802,9 802,11 @@ public class DatabaseBackend extends SQLiteOpenHelper {
        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues cv = new ContentValues();
        cv.put("cid", cid.toString());
        cv.put("path", file.getAbsolutePath());
        cv.put("url", url);
        db.insertWithOnConflict("cheogram.cids", null, cv, SQLiteDatabase.CONFLICT_REPLACE);
        if (file != null) cv.put("path", file.getAbsolutePath());
        if (url != null) cv.put("url", url);
        if (db.update("cheogram.cids", cv, "cid=?", new String[]{cid.toString()}) < 1) {
            db.insertWithOnConflict("cheogram.cids", null, cv, SQLiteDatabase.CONFLICT_REPLACE);
        }
    }

    public void blockMedia(Cid cid) {

M src/main/java/eu/siacs/conversations/persistance/FileBackend.java => src/main/java/eu/siacs/conversations/persistance/FileBackend.java +1 -1
@@ 1823,7 1823,7 @@ public class FileBackend {
        if (updateCids) {
            try {
                for (int i = 0; i < cids.length; i++) {
                    mXmppConnectionService.saveCid(cids[i], file, url);
                    mXmppConnectionService.saveCid(cids[i], file);
                }
            } catch (XmppConnectionService.BlockedMediaException e) { }
        }