forked from mirror/monocles_chat
Don't update url unless we have a reason to (Cheogram)
This commit is contained in:
parent
12fe325683
commit
766dd86b7f
2 changed files with 6 additions and 4 deletions
|
@ -1210,9 +1210,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("monocles.cids", null, cv, SQLiteDatabase.CONFLICT_REPLACE);
|
||||
if (file != null) cv.put("path", file.getAbsolutePath());
|
||||
if (url != null) cv.put("url", url);
|
||||
if (db.update("monocles.cids", cv, "cid=?", new String[]{cid.toString()}) < 1) {
|
||||
db.insertWithOnConflict("monocles.cids", null, cv, SQLiteDatabase.CONFLICT_REPLACE);
|
||||
}
|
||||
}
|
||||
|
||||
public static class FilePath {
|
||||
|
|
|
@ -1789,7 +1789,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) { }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue