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
|
||||
&& message.getServerMsgId() != null) {
|
||||
duplicate.setServerMsgId(message.getServerMsgId());
|
||||
mXmppConnectionService.databaseBackend.updateMessage(message);
|
||||
if (mXmppConnectionService.databaseBackend.updateMessage(duplicate)) {
|
||||
serverMsgIdUpdated = true;
|
||||
} else {
|
||||
serverMsgIdUpdated = false;
|
||||
Log.e(Config.LOGTAG,"failed to update message");
|
||||
}
|
||||
} else {
|
||||
serverMsgIdUpdated = false;
|
||||
}
|
||||
|
|
|
@ -825,11 +825,10 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
|||
return db;
|
||||
}
|
||||
|
||||
public void updateMessage(Message message) {
|
||||
public boolean updateMessage(Message message) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
String[] args = {message.getUuid()};
|
||||
db.update(Message.TABLENAME, message.getContentValues(), Message.UUID
|
||||
+ "=?", args);
|
||||
return db.update(Message.TABLENAME, message.getContentValues(), Message.UUID + "=?", args) == 1;
|
||||
}
|
||||
|
||||
public void updateMessage(Message message, String uuid) {
|
||||
|
|
Loading…
Reference in a new issue