The current notification system has got a big downside: Similar notifications were not grouped together. This restricted the possibilities, as you could not send notifications for likes and other events happening at a similar rate. It would completely clutter the notification center. Therefore we introduced notification stacking. Making use of stacking only requires small changes to your IUserNotificationEvent implementation:
- Set the attribute $stackable to true
- Override getEventHash() in case the default implementation (eventID + objectID) does not fit. The system groups notifications with the same hash.
- Update getTitle() and getMessage()
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.title.stacked', array(return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message.stacked', array(return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.message', array(
Read “Notification stacking” first, please.
One of the most requested feature was notifications for likes. You definitely should not leave them out when updating your plugin to make use of the new features of Community Framework 2.1!
The sendNotification(Like $like) method of your \wcf\data\like\object\ILikeObject implementation will be called when you should send a new notification. As the actual objects can differ a lot there is unfortunately no default implementation for this method. We provided you with a default IUserNotificationObject implementation and a default IUserNotificationObjectType implementation, though. For a proper implementation the following is required:
- An object type
- A user notification event definition
- Implementation of sendNotification()
- Implementation of the IUserNotificationEvent
- Some language items
If you already implemented notifications the following should look familiar:
You could not properly quote attachments in Community Framework 2.0 for performance reasons. Community Framework 2.1 solves this issue by the embedded object system. You are now able to register the objects that are embedded in your message and can afterwards fetch them with a single function call. This allows for some other great futures, such as avatars beside quotes as well. This is how you integrate the embedded object system:
When adding a new message:
When updating a message:
When deleting a message:
When loading messages (example taken from quick reply):
When showing messages:
This feature is not forward compatible: The installation will fail in Community Framework 2.0, due to the missing object type definition!