Execute notification command only if there is a source param

This commit is contained in:
Mattia Codato 2020-07-29 08:52:15 +02:00 committed by Noah Hilverling
parent c019dc9f90
commit 3d85492b9a

View File

@ -298,7 +298,7 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
throw; throw;
} }
} }
} else if (command_type == "notification_command") { } else if (command_type == "notification_command" && params->Contains("source")) {
/* Get user */ /* Get user */
User::Ptr user = new User(); User::Ptr user = new User();
Dictionary::Ptr attrs = new Dictionary(); Dictionary::Ptr attrs = new Dictionary();
@ -324,7 +324,6 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
notificationCommand->Execute(notification, user, cr, NotificationType::NotificationCustom, notificationCommand->Execute(notification, user, cr, NotificationType::NotificationCustom,
author, ""); author, "");
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
if (params->Contains("source")) {
String output = "Exception occurred during notification '" + notification->GetName() String output = "Exception occurred during notification '" + notification->GetName()
+ "' for checkable '" + notification->GetCheckable()->GetName() + "' for checkable '" + notification->GetCheckable()->GetName()
+ "' and user '" + user->GetName() + "' using command '" + command + "': " + "' and user '" + user->GetName() + "' using command '" + command + "': "
@ -334,7 +333,6 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
} }
} }
} }
}
int ClusterEvents::GetCheckRequestQueueSize() int ClusterEvents::GetCheckRequestQueueSize()
{ {