Fixed notification issue
authorMarcel Werk <burntime@woltlab.com>
Sun, 3 Feb 2013 23:58:39 +0000 (00:58 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 3 Feb 2013 23:58:39 +0000 (00:58 +0100)
files/lib/data/conversation/ConversationAction.class.php

index 8cf8901dae749b08ca2c941db234968a51107f35..227ca9cc155aae539d6660d5295103cb9ff1f00f 100644 (file)
@@ -134,13 +134,13 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                                $conversation->updateParticipantSummary();
                                
                                // check if new participants have been added
-                               $participantIDs = array_diff($participantIDs, $this->parameters['participants'], $this->parameters['invisibleParticipants']);
-                               if (!empty($participantIDs)) {
+                               $newParticipantIDs = array_diff(array_merge($this->parameters['participants'], $this->parameters['invisibleParticipants']), $participantIDs);
+                               if (!empty($newParticipantIDs)) {
                                        // update conversation count
-                                       UserStorageHandler::getInstance()->reset($participantIDs, 'conversationCount');
+                                       UserStorageHandler::getInstance()->reset($newParticipantIDs, 'conversationCount');
                                        
                                        // fire notification event
-                                       UserNotificationHandler::getInstance()->fireEvent('conversation', 'com.woltlab.wcf.conversation.notification', new ConversationUserNotificationObject($conversation->getDecoratedObject()), $participantIDs);
+                                       UserNotificationHandler::getInstance()->fireEvent('conversation', 'com.woltlab.wcf.conversation.notification', new ConversationUserNotificationObject($conversation->getDecoratedObject()), $newParticipantIDs);
                                }
                        }