feat: send email notifications for missed messages

- New cron job in cluster
- Handle presence and other concerns
- Toggle in app to disable email notifications
- Handles other edge cases such as cooldown period
- Simple html email with simple message

Closes #117
This commit is contained in:
talksik
2026-04-09 14:15:34 -07:00
parent 6fe5af8d8d
commit 51c4c6c822
25 changed files with 725 additions and 29 deletions
+15
View File
@@ -72,7 +72,22 @@ func (s *Server) HandleWebSocket(w http.ResponseWriter, r *http.Request) {
}
// BulkGetPresence implements the gRPC PusherService.
// When channel_ids is empty, returns all connected humanIDs across all channels
// under the key "_all" — useful for checking overall online status.
func (s *Server) BulkGetPresence(ctx context.Context, req *pbpusher.BulkGetPresenceRequest) (*pbpusher.BulkGetPresenceResponse, error) {
// Empty channel_ids → return all connected humans
if len(req.ChannelIds) == 0 {
humanIDs, err := s.bridge.GetAllConnectedHumanIDs(ctx)
if err != nil {
return nil, err
}
return &pbpusher.BulkGetPresenceResponse{
Presences: map[string]*pbpusher.ChannelPresence{
"_all": {HumanIds: humanIDs},
},
}, nil
}
presence, err := s.bridge.GetPresence(ctx, req.ChannelIds)
if err != nil {
return nil, err