Improved stacking of wall comments
authorAlexander Ebert <ebert@woltlab.com>
Fri, 20 Jun 2014 11:13:38 +0000 (13:13 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 20 Jun 2014 11:13:38 +0000 (13:13 +0200)
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index b024727c1cb47dd882f649822983f4ebb817db2a..1cac2542bc0ac62cb7dc5e7448417233539bfe20 100644 (file)
@@ -56,6 +56,7 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractUserN
                $count = count($authors);
                if ($count > 1) {
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.message.stacked', array(
+                               'author' => $commentAuthor,
                                'authors' => $authors,
                                'count' => $count,
                                'others' => max($count - 1, 0)
index b5e54101b2c711a39080f49a631acc1d37456d19..224e647b8aa18b2937fbfd82f0c37f7b1038c005 100644 (file)
@@ -55,7 +55,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractUserNotifi
                $authors = array_values($this->getAuthors());
                $count = count($authors);
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.message.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message.stacked', array(
                                'authors' => $authors,
                                'count' => $count,
                                'others' => max($count - 1, 0),
@@ -94,4 +94,11 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractUserNotifi
                
                return LinkHandler::getInstance()->getLink('User', array('object' => $user), '#wall');
        }
+       
+       /**
+        * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
+        */
+       public function getEventHash() {
+               return sha1($this->eventID . '-' . $this->userNotificationObject->commentID);
+       }
 }
index 21510b23f8ab767768f6322fbcdec1a5bf068355..535a14b8e74f856c103c987ea37d881c8d10b2a2 100644 (file)
@@ -2868,7 +2868,7 @@ Möchten Sie diese E-Mail-Benachrichtigung in Zukunft nicht mehr erhalten, könn
                <item name="wcf.user.notification.commentResponse.title"><![CDATA[Neue Antwort (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} neue Antworten (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.message"><![CDATA[Hat eine Antwort zu Ihrem Kommentar an der Pinnwand von {$owner->username} verfasst.]]></item>
-               <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Ihren Kommentare an der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a> geantwortet.]]></item>
+               <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Ihren Kommentar an der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a> geantwortet.]]></item>
                <item name="wcf.user.notification.commentResponse.mail"><![CDATA[{@$author->username} hat eine Antwort zu Ihrem Kommentar an der Pinnwand von "{@$owner->username}" verfasst:
 {if $notificationType == 'instant'}
 ---------------------------------
@@ -2876,9 +2876,9 @@ Möchten Sie diese E-Mail-Benachrichtigung in Zukunft nicht mehr erhalten, könn
 ---------------------------------
 {/if}{link controller='User' object=$owner isEmail=true}{/link}#wall]]></item>
                <item name="wcf.user.notification.commentResponseOwner.title"><![CDATA[Neue Antwort (Pinnwand)]]></item>
-               <item name="wcf.user.notification.commentResponseOwner.title.stacked"><![CDATA[{$#timesTriggered} neue Antworten (Pinnwand)]]></item>
+               <item name="wcf.user.notification.commentResponseOwner.title.stacked"><![CDATA[{#$timesTriggered} neue Antworten (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponseOwner.message"><![CDATA[Hat eine Antwort zum Kommentar von {$commentAuthor->username} an Ihrer Pinnwand verfasst.]]></item>
-               <item name="wcf.user.notification.commentResponseOwner.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Kommentare an <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a> geantwortet.]]></item>
+               <item name="wcf.user.notification.commentResponseOwner.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf den Kommentar von {if $author->userID}<a href="{link controller='User' object=$author}{/link}" class="userLink" data-user-id="{@$author->userID}">{$author->username}</a>{else}{$author->username}{/if} an <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a> geantwortet.]]></item>
                <item name="wcf.user.notification.commentResponseOwner.mail"><![CDATA[{@$author->username} hat eine Antwort zum Kommentar von "{@$commentAuthor->username}" an Ihrer Pinnwand verfasst:
 {if $notificationType == 'instant'}
 ---------------------------------
index 1a6d29c89ce8a90d2de3852389de962cf7b9e885..dee5ef8f39e0ea2fd3a3ac770ffe590e3c6c7bbf 100644 (file)
@@ -2711,7 +2711,9 @@ If you do not want to receive further email notifications for this event, you ca
                <item name="wcf.user.notification.com.woltlab.wcf.user"><![CDATA[User Profiles]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.user.follow.following"><![CDATA[New follower]]></item>
                <item name="wcf.user.notification.comment.title"><![CDATA[New Comment (Wall)]]></item>
+               <item name="wcf.user.notification.comment.title.stacked"><![CDATA[{#$timesTriggered} new comments (Wall)]]></item>
                <item name="wcf.user.notification.comment.message"><![CDATA[Wrote a comment on your wall.]]></item>
+               <item name="wcf.user.notification.comment.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} wrote comments on <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">your wall</a>.]]></item>
                <item name="wcf.user.notification.comment.mail"><![CDATA[{@$author->username} wrote a comment on your wall:
 {if $notificationType == 'instant'}
 ---------------------------------
@@ -2719,7 +2721,9 @@ If you do not want to receive further email notifications for this event, you ca
 ---------------------------------
 {/if}{link controller='User' object=$owner isEmail=true}#wall{/link}]]></item>
                <item name="wcf.user.notification.commentResponse.title"><![CDATA[New Reply (Wall)]]></item>
+               <item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} new replies (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.message"><![CDATA[Wrote a reply to your comment on {$owner->username}’s wall.]]></item>
+               <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} replied to your comment on <a href="{link controller='User' object=$owner}#wall{/link}">{$owner->username}’s wall</a>.]]></item>
                <item name="wcf.user.notification.commentResponse.mail"><![CDATA[{@$author->username} wrote a reply to your comment on {@$owner->username}’s wall:
 {if $notificationType == 'instant'}
 ---------------------------------
@@ -2727,7 +2731,9 @@ If you do not want to receive further email notifications for this event, you ca
 ---------------------------------
 {/if}{link controller='User' object=$owner isEmail=true}{/link}#wall]]></item>
                <item name="wcf.user.notification.commentResponseOwner.title"><![CDATA[New Reply (Wall)]]></item>
+               <item name="wcf.user.notification.commentResponseOwner.title.stacked"><![CDATA[{#$timesTriggered} new replies (Wall)]]></item>
                <item name="wcf.user.notification.commentResponseOwner.message"><![CDATA[Wrote a reply to {$commentAuthor->username}’s comment on your wall.]]></item>
+               <item name="wcf.user.notification.commentResponseOwner.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} replied to the comment by {if $author->userID}<a href="{link controller='User' object=$author}{/link}" class="userLink" data-user-id="{@$author->userID}">{$author->username}</a>{else}{$author->username}{/if} on <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">your wall</a>.]]></item>
                <item name="wcf.user.notification.commentResponseOwner.mail"><![CDATA[{@$author->username} wrote a reply to {@$commentAuthor->username}’s comment on your wall:
 {if $notificationType == 'instant'}
 ---------------------------------