fixed updating of server message id after dedup
This commit is contained in:
parent
2992ba647d
commit
fc62cbbc52
|
@ -520,8 +520,12 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
||||||
&& duplicate.getServerMsgId() == null
|
&& duplicate.getServerMsgId() == null
|
||||||
&& message.getServerMsgId() != null) {
|
&& message.getServerMsgId() != null) {
|
||||||
duplicate.setServerMsgId(message.getServerMsgId());
|
duplicate.setServerMsgId(message.getServerMsgId());
|
||||||
mXmppConnectionService.databaseBackend.updateMessage(message);
|
if (mXmppConnectionService.databaseBackend.updateMessage(duplicate)) {
|
||||||
serverMsgIdUpdated = true;
|
serverMsgIdUpdated = true;
|
||||||
|
} else {
|
||||||
|
serverMsgIdUpdated = false;
|
||||||
|
Log.e(Config.LOGTAG,"failed to update message");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
serverMsgIdUpdated = false;
|
serverMsgIdUpdated = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -825,11 +825,10 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateMessage(Message message) {
|
public boolean updateMessage(Message message) {
|
||||||
SQLiteDatabase db = this.getWritableDatabase();
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
String[] args = {message.getUuid()};
|
String[] args = {message.getUuid()};
|
||||||
db.update(Message.TABLENAME, message.getContentValues(), Message.UUID
|
return db.update(Message.TABLENAME, message.getContentValues(), Message.UUID + "=?", args) == 1;
|
||||||
+ "=?", args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateMessage(Message message, String uuid) {
|
public void updateMessage(Message message, String uuid) {
|
||||||
|
|
Loading…
Reference in New Issue