mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-04 02:09:39 +02:00
show the device-update-message only once, not on every account switch (#3069)
* show the device-update-message only once, not on every account switch * instead of not adding device messages twice, always add and mark the chat as being noticed * remove unused variable
This commit is contained in:
parent
15db6e5d91
commit
1884f9bc4f
2 changed files with 10 additions and 0 deletions
|
@ -127,6 +127,14 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||||
+ "For more changes worth testing see https://delta.chat/changelog");
|
+ "For more changes worth testing see https://delta.chat/changelog");
|
||||||
//}
|
//}
|
||||||
dcContext.addDeviceMsg(deviceMsgId, msg);
|
dcContext.addDeviceMsg(deviceMsgId, msg);
|
||||||
|
|
||||||
|
if (Prefs.getStringPreference(this, Prefs.LAST_DEVICE_MSG_ID, "").equals(deviceMsgId)) {
|
||||||
|
int deviceChatId = dcContext.getChatIdByContactId(DcContact.DC_CONTACT_ID_DEVICE);
|
||||||
|
if (deviceChatId != 0) {
|
||||||
|
dcContext.marknoticedChat(deviceChatId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Prefs.setStringPreference(this, Prefs.LAST_DEVICE_MSG_ID, deviceMsgId);
|
||||||
}
|
}
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -64,6 +64,8 @@ public class Prefs {
|
||||||
public static final String ALWAYS_LOAD_REMOTE_CONTENT = "pref_always_load_remote_content";
|
public static final String ALWAYS_LOAD_REMOTE_CONTENT = "pref_always_load_remote_content";
|
||||||
public static final boolean ALWAYS_LOAD_REMOTE_CONTENT_DEFAULT = false;
|
public static final boolean ALWAYS_LOAD_REMOTE_CONTENT_DEFAULT = false;
|
||||||
|
|
||||||
|
public static final String LAST_DEVICE_MSG_ID = "pref_last_device_msg_id";
|
||||||
|
|
||||||
public enum VibrateState {
|
public enum VibrateState {
|
||||||
DEFAULT(0), ENABLED(1), DISABLED(2);
|
DEFAULT(0), ENABLED(1), DISABLED(2);
|
||||||
private final int id;
|
private final int id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue