];
}
- /**
- * Validates parameters to return the mixed conversation list.
- *
- * @deprecated 5.5
- */
- public function validateGetMixedConversationList()
- {
- // does nothing
- }
-
- /**
- * Returns a mixed conversation list with up to 10 unread conversations.
- *
- * @return mixed[][]
- * @deprecated 5.5 This method provided the data for the legacy user panel implementation.
- */
- public function getMixedConversationList()
- {
- $sqlSelect = ' , (
- SELECT participantID
- FROM wcf' . WCF_N . '_conversation_to_user
- WHERE conversationID = conversation.conversationID
- AND participantID <> conversation.userID
- AND isInvisible = 0
- ORDER BY username, participantID
- LIMIT 1
- ) AS otherParticipantID
- , (
- SELECT username
- FROM wcf' . WCF_N . '_conversation_to_user
- WHERE conversationID = conversation.conversationID
- AND participantID <> conversation.userID
- AND isInvisible = 0
- ORDER BY username, participantID
- LIMIT 1
- ) AS otherParticipant';
-
- $unreadConversationList = new UserConversationList(WCF::getUser()->userID);
- $unreadConversationList->sqlSelects .= $sqlSelect;
- $unreadConversationList->getConditionBuilder()->add('conversation_to_user.lastVisitTime < lastPostTime');
- $unreadConversationList->sqlLimit = 10;
- $unreadConversationList->sqlOrderBy = 'lastPostTime DESC';
- $unreadConversationList->readObjects();
-
- $conversations = [];
- $count = 0;
- foreach ($unreadConversationList as $conversation) {
- $conversations[] = $conversation;
- $count++;
- }
-
- if ($count < 10) {
- $conversationList = new UserConversationList(WCF::getUser()->userID);
- $conversationList->sqlSelects .= $sqlSelect;
- $conversationList->getConditionBuilder()->add('conversation_to_user.lastVisitTime >= lastPostTime');
- $conversationList->sqlLimit = (10 - $count);
- $conversationList->sqlOrderBy = 'lastPostTime DESC';
- $conversationList->readObjects();
-
- foreach ($conversationList as $conversation) {
- $conversations[] = $conversation;
- }
- }
-
- WCF::getTPL()->assign([
- 'conversations' => $conversations,
- ]);
-
- $totalCount = ConversationHandler::getInstance()->getUnreadConversationCount();
- if ($count < 10 && $count < $totalCount) {
- UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadConversationCount');
- }
-
- return [
- 'template' => WCF::getTPL()->fetch('conversationListUserPanel'),
- 'totalCount' => $totalCount,
- ];
- }
-
/**
* @since 5.5
*/
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/2019/templateDelete.xsd">
<delete>
- <template>__userStartConversation</template>
- <template>conversationListUnread</template>
- <template>conversationLog</template>
- <template>conversationMessageAdd</template>
- <template>conversationMessageEdit</template>
- <template>searchResultConversationMessage</template>
+ <template>conversationListUserPanel</template>
</delete>
</data>
+++ /dev/null
-{foreach from=$conversations item=conversation}
- <li class="conversationItem{if $conversation->lastVisitTime < $conversation->lastPostTime} conversationItemUnread interactiveDropdownItemOutstanding{/if}" data-link="{link controller='Conversation' object=$conversation}action=firstNew{/link}" data-object-id="{@$conversation->conversationID}" data-is-read="{if $conversation->lastVisitTime < $conversation->lastPostTime}false{else}true{/if}">
- <div class="box48">
- <div>
- {if $conversation->userID == $__wcf->user->userID}
- {if $conversation->participants > 1}
- <span class="icon icon48 fa-users"></span>
- {else}
- {@$conversation->getOtherParticipantProfile()->getAvatar()->getImageTag(48)}
- {/if}
- {else}
- {@$conversation->getUserProfile()->getAvatar()->getImageTag(48)}
- {/if}
- </div>
- <div>
- <h3><a href="{link controller='Conversation' object=$conversation}action=firstNew{/link}">{$conversation->subject}</a></h3>
- <small class="conversationInfo">
- <span class="conversationParticipant">
- {if $conversation->userID == $__wcf->user->userID}
- {if $conversation->participants > 1}
- {assign var='participantSummaryCount' value=$conversation->getParticipantSummary()|count}
- {implode from=$conversation->getParticipantSummary() item=participant}<a href="{$participant->getLink()}" class="userLink{if $participant->hideConversation == 2} conversationLeft{/if}" data-object-id="{@$participant->userID}">{$participant->username}</a>{/implode}
- {if $participantSummaryCount < $conversation->participants}{lang}wcf.conversation.participants.other{/lang}{/if}
- {else}
- {user object=$conversation->getOtherParticipantProfile()}
- {/if}
- {else}
- {user object=$conversation->getUserProfile()}
- {/if}
- </span>
-
- <span class="conversationLastPostTime">{@$conversation->lastPostTime|time}</span>
- </small>
- </div>
- </div>
- </li>
-{/foreach}