Skip to content

Commit 564b7a8

Browse files
author
Github
committed
Fixed a bug where new messages are automatically flagged as sent, essentially making all the hard work of sockets useless!
1 parent c0e1ed2 commit 564b7a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
minSdkVersion 19
99
targetSdkVersion 25
1010
versionCode 4
11-
versionName "1.2.0.1"
11+
versionName "1.2.0.2"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
1414
buildTypes {

app/src/main/java/eu/aero2x/andromedab/Conversation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public boolean onSubmit(final CharSequence input) {
110110
" \"date\" : "+ ((System.currentTimeMillis())/1000-978307200L) + ",\n" + //Convert epoch to cocoa
111111
" \"text\" : \"" + input.toString().replace("\\","\\\\").replace("\"","\\\"").replace("\n","\\n") +"\",\n" + //manually escape for JSON. It's bad but unexploitable
112112
" \"is_from_me\" : 1,\n" +
113-
" \"error\" : 0,\n" +
113+
" \"error\" : -23813,\n" +
114114
" \"guid\" : \"notSent"+ (int)(Math.random()*2000) + "\",\n" + //random bit so we can be sure we replace the right GUID
115115
" \"date_delivered\" : 0,\n" +
116116
" \"is_sent\" : 0,\n" +
@@ -406,7 +406,7 @@ public boolean isDelivered() {
406406
@Override
407407
public boolean isSent() {
408408
try {
409-
return messageBundle.getInt("error") == 0 || messageBundle.getInt("is_sent") == 0;
409+
return messageBundle.getInt("error") == 0 || messageBundle.getInt("is_sent") == 1;
410410
}catch (JSONException e) {
411411
return false;
412412
}

0 commit comments

Comments
 (0)