forked from cwtch.im/cwtch-ui
Combined if statements
This commit is contained in:
parent
088cebcc6b
commit
73690e8bac
|
@ -149,8 +149,7 @@ class CwtchNotifier {
|
||||||
var currentTotal = profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages;
|
var currentTotal = profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages;
|
||||||
|
|
||||||
// Only bother to do anything if we know about the group and the provided index is greater than our current total...
|
// Only bother to do anything if we know about the group and the provided index is greater than our current total...
|
||||||
if (currentTotal != null) {
|
if (currentTotal != null && idx >= currentTotal) {
|
||||||
if (idx >= currentTotal) {
|
|
||||||
profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages = idx + 1;
|
profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["GroupID"])!.totalMessages = idx + 1;
|
||||||
|
|
||||||
//if not currently open
|
//if not currently open
|
||||||
|
@ -171,7 +170,6 @@ class CwtchNotifier {
|
||||||
// and `local now`.
|
// and `local now`.
|
||||||
profileCN.getProfile(data["ProfileOnion"])?.contactList.updateLastMessageTime(data["GroupID"], timestampSent.toLocal());
|
profileCN.getProfile(data["ProfileOnion"])?.contactList.updateLastMessageTime(data["GroupID"], timestampSent.toLocal());
|
||||||
notificationManager.notify("New Message From Group!");
|
notificationManager.notify("New Message From Group!");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// from me (already displayed - do not update counter)
|
// from me (already displayed - do not update counter)
|
||||||
|
|
Loading…
Reference in New Issue