Fixed notification issue
authorMarcel Werk <burntime@woltlab.com>
Fri, 1 Feb 2013 21:14:59 +0000 (22:14 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 1 Feb 2013 21:14:59 +0000 (22:14 +0100)
files/lib/data/conversation/message/ConversationMessageAction.class.php

index 0c775fcdd9ad5047ddc306b5478c3177d1a79fc0..2c2ff526512ab68802d9803c99b2e830ecd11c1c 100644 (file)
@@ -82,7 +82,10 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        
                        // fire notification event
                        if (!$conversation->isDraft) {
-                               UserNotificationHandler::getInstance()->fireEvent('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', new ConversationMessageUserNotificationObject($message), $conversation->getParticipantIDs());
+                               $notificationRecipients = array_diff($conversation->getParticipantIDs(), array($message->userID)); // don't notify message author
+                               if (!empty($notificationRecipients)) {
+                                       UserNotificationHandler::getInstance()->fireEvent('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', new ConversationMessageUserNotificationObject($message), $notificationRecipients);
+                               }
                        }
                        
                        // make invisible participant visible