mirror of
https://github.com/TakeV-Lambda/Tooth.git
synced 2024-09-27 13:13:20 +00:00
feat: withdraw notifications of session
This commit is contained in:
parent
83a6944605
commit
0b71d45ed0
|
@ -127,7 +127,8 @@ public class Tooth.InstanceAccount : API.Account, Streamable {
|
|||
public bool has_unread { get; set; default = false; }
|
||||
public int last_read_id { get; set; default = 0; }
|
||||
public int last_received_id { get; set; default = 0; }
|
||||
public HashMap<int,GLib.Notification> unread_toasts { get; set; default = new HashMap<int,GLib.Notification> (); }
|
||||
// public HashMap<int,GLib.Notification> unread_toasts { get; set; default = new HashMap<int,GLib.Notification> (); }
|
||||
public ArrayList<string> sent_notification_ids { get; set; default = new ArrayList<string> (); }
|
||||
public ArrayList<Object> notification_inhibitors { get; set; default = new ArrayList<Object> (); }
|
||||
private bool passed_init_notifications = false;
|
||||
|
||||
|
@ -181,6 +182,13 @@ public class Tooth.InstanceAccount : API.Account, Streamable {
|
|||
|
||||
unread_count = 0;
|
||||
has_unread = false;
|
||||
|
||||
if (sent_notification_ids.size > 0) {
|
||||
sent_notification_ids.@foreach (entry => {
|
||||
app.withdraw_notification (entry);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
// unread_toasts.@foreach (entry => {
|
||||
// var id = entry.key;
|
||||
// read_notification (id);
|
||||
|
@ -202,6 +210,7 @@ public class Tooth.InstanceAccount : API.Account, Streamable {
|
|||
var toast = obj.to_toast (this);
|
||||
var id = obj.id;
|
||||
app.send_notification (id, toast);
|
||||
sent_notification_ids.add(id);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue