added filtering to activity logs for desktop
This commit is contained in:
@@ -124,11 +124,15 @@ public class ActivityLoggingFilter extends OncePerRequestFilter {
|
||||
}
|
||||
}
|
||||
case "chat" -> {
|
||||
if ("conversations".equals(seg3) && isPost) return "Started a new chat conversation";
|
||||
if (seg3IsId && "messages".equals(sub) && isPost) return "Sent a chat message";
|
||||
if (seg3IsId && "attachments".equals(sub) && isPost) return "Sent a file in chat";
|
||||
if (seg3IsId && "request-human".equals(sub) && isPost) return "Requested human support in chat";
|
||||
if (seg3IsId && isPut) return "Updated chat conversation #" + id;
|
||||
if ("conversations".equals(seg3) && isPost && seg4 == null) return "Started a new chat conversation";
|
||||
if ("conversations".equals(seg3) && seg4IsId) {
|
||||
String convId = seg4;
|
||||
String chatSub = parts.length > 5 ? parts[5] : null;
|
||||
if ("messages".equals(seg5) && isPost) return "Sent a chat message";
|
||||
if ("attachments".equals(seg5) && isPost) return "Sent a file in chat";
|
||||
if ("request-human".equals(seg5) && isPost) return "Requested human support in chat";
|
||||
if (chatSub == null && isPut) return "Updated chat conversation #" + convId;
|
||||
}
|
||||
}
|
||||
case "ai-chat" -> {
|
||||
if ("message".equals(seg3) && isPost) return "Sent a message to the AI assistant";
|
||||
|
||||
@@ -145,10 +145,10 @@ public class EmailService {
|
||||
.html(html)
|
||||
.build();
|
||||
resend.emails().send(options);
|
||||
activityLogService.record(recipientUserId, "Email sent: " + subject + " → " + to);
|
||||
activityLogService.record(recipientUserId, "Sent an email | Email sent: " + subject + " → " + to);
|
||||
} catch (Exception ex) {
|
||||
log.error("Failed to send email '{}' to {}: {}", subject, to, ex.getMessage());
|
||||
activityLogService.record(recipientUserId, "Email failed: " + subject + " → " + to);
|
||||
activityLogService.record(recipientUserId, "Failed to send email | Email failed: " + subject + " → " + to);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user