mirror of
https://github.com/Jetsparrow/jetherald.git
synced 2026-01-20 23:56:08 +03:00
Display heart in heartbeat messages
This commit is contained in:
parent
7fdaf43eb9
commit
b423b8358d
@ -70,11 +70,11 @@ namespace JetHerald.Controllers
|
||||
else if (!t.WriteToken.Equals(args.WriteToken, StringComparison.Ordinal))
|
||||
return StatusCode(403);
|
||||
|
||||
|
||||
|
||||
var affected = await Db.ReportHeartbeat(t.TopicId, heart, args.ExpiryTimeout);
|
||||
|
||||
if (affected == 1)
|
||||
await Herald.HeartbeatSent(t);
|
||||
await Herald.HeartbeatSent(t, heart);
|
||||
|
||||
return new OkResult();
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ namespace JetHerald
|
||||
{
|
||||
var chats = await Db.GetChatsForTopic(attack.TopicId);
|
||||
foreach (var chat in chats)
|
||||
await SendMessageImpl(chat, $"!{attack.Description}!:\nTimeout expired at {attack.ExpiryTime}");
|
||||
await SendMessageImpl(chat, $"!{attack.Description}!:\nHeart \"{attack.Heart}\" stopped beating at {attack.ExpiryTime}");
|
||||
await Db.MarkHeartAttackReported(attack.HeartattackId);
|
||||
if (token.IsCancellationRequested)
|
||||
return;
|
||||
@ -108,8 +108,8 @@ namespace JetHerald
|
||||
}
|
||||
}
|
||||
|
||||
public Task HeartbeatSent(Db.Topic topic)
|
||||
=> BroadcastMessageImpl(topic, $"!{topic.Description}!:\nA heartbeat has been sent.");
|
||||
public Task HeartbeatSent(Db.Topic topic, string heart)
|
||||
=> BroadcastMessageImpl(topic, $"!{topic.Description}!:\nHeart \"{heart}\" has started beating.");
|
||||
|
||||
public Task PublishMessage(Db.Topic topic, string message)
|
||||
=> BroadcastMessageImpl(topic, $"|{topic.Description}|:\n{message}");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user