This commit is contained in:
@@ -96,7 +96,7 @@ namespace AyaNova.Biz
|
||||
if (deliverAfter < DateTime.UtcNow)
|
||||
{
|
||||
if (Subscription.DeliveryMethod == NotifyDeliveryMethod.App)
|
||||
await DeliverInApp(notifyevent, ct);
|
||||
await DeliverInApp(notifyevent, Subscription.AgeValue, ct);
|
||||
else if (Subscription.DeliveryMethod == NotifyDeliveryMethod.SMTP)
|
||||
await DeliverSMTP(notifyevent, Subscription.DeliveryAddress, ct);
|
||||
}
|
||||
@@ -117,10 +117,10 @@ namespace AyaNova.Biz
|
||||
|
||||
}
|
||||
|
||||
private static async Task DeliverInApp(NotifyEvent ne, AyContext ct)
|
||||
private static async Task DeliverInApp(NotifyEvent ne, TimeSpan ageValue, AyContext ct)
|
||||
{
|
||||
log.LogTrace($"DeliverInApp notify event: {ne}");
|
||||
await ct.Notification.AddAsync(new Notification() { UserId = ne.UserId, AyaType = ne.AyaType, ObjectId = ne.ObjectId, EventType = ne.EventType, NotifySubscriptionId = ne.NotifySubscriptionId, Message = ne.Message, Name = ne.Name });
|
||||
await ct.Notification.AddAsync(new Notification() { UserId = ne.UserId, AyaType = ne.AyaType, ObjectId = ne.ObjectId, EventType = ne.EventType, NotifySubscriptionId = ne.NotifySubscriptionId, Message = ne.Message, Name = ne.Name, AgeValue = ageValue });
|
||||
await ct.SaveChangesAsync();
|
||||
ct.NotifyEvent.Remove(ne);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user