diff --git a/src/org/linphone/ChatStorage.java b/src/org/linphone/ChatStorage.java index 714de16b1..b082d43b5 100644 --- a/src/org/linphone/ChatStorage.java +++ b/src/org/linphone/ChatStorage.java @@ -81,7 +81,7 @@ public class ChatStorage { db.update(TABLE_NAME, values, "id LIKE " + id, null); } - public int saveMessage(String from, String to, String message) { + public int saveMessage(String from, String to, String message, long time) { ContentValues values = new ContentValues(); if (from.equals("")) { values.put("localContact", from); @@ -97,11 +97,11 @@ public class ChatStorage { values.put("status", LinphoneChatMessage.State.Idle.toInt()); } values.put("message", message); - values.put("time", System.currentTimeMillis()); + values.put("time", time); return (int) db.insert(TABLE_NAME, null, values); } - public int saveMessage(String from, String to, Bitmap image) { + public int saveMessage(String from, String to, Bitmap image, long time) { if (image == null) return -1; @@ -124,7 +124,7 @@ public class ChatStorage { image.compress(CompressFormat.JPEG, 100, baos); values.put("image", baos.toByteArray()); - values.put("time", System.currentTimeMillis()); + values.put("time", time); return (int) db.insert(TABLE_NAME, null, values); } diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 205c53672..bcf4a70d0 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -740,12 +740,12 @@ public class LinphoneActivity extends FragmentActivity implements public int onMessageSent(String to, String message) { getChatStorage().deleteDraft(to); - return getChatStorage().saveMessage("", to, message); + return getChatStorage().saveMessage("", to, message, System.currentTimeMillis()); } public int onMessageSent(String to, Bitmap image, String imageURL) { getChatStorage().deleteDraft(to); - return getChatStorage().saveMessage("", to, image); + return getChatStorage().saveMessage("", to, image, System.currentTimeMillis()); } public void onMessageStateChanged(String to, String message, int newState) { diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index c60272ebf..701f2e4e7 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1106,11 +1106,11 @@ public final class LinphoneManager implements LinphoneCoreListener { String notificationText = null; int id = -1; if (textMessage != null && textMessage.length() > 0) { - id = chatStorage.saveMessage(from.asStringUriOnly(), "", textMessage); + id = chatStorage.saveMessage(from.asStringUriOnly(), "", textMessage, message.getTime()); notificationText = textMessage; } else if (url != null && url.length() > 0) { Bitmap bm = ChatFragment.downloadImage(url); - id = chatStorage.saveMessage(from.asStringUriOnly(), "", bm); + id = chatStorage.saveMessage(from.asStringUriOnly(), "", bm, message.getTime()); notificationText = url; } diff --git a/submodules/linphone b/submodules/linphone index 0dadf758c..3bf7dd21d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 0dadf758c3bcd5ca26011cc2eee63a9abaa3e7fc +Subproject commit 3bf7dd21dc68302928e90b5c33949e5ea913bec6