* @return mixed[][]
*/
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 < conversation.lastPostTime');
$unreadConversationList->sqlLimit = 10;
$unreadConversationList->sqlOrderBy = 'conversation.lastPostTime DESC';
if ($count < 10) {
$conversationList = new UserConversationList(WCF::getUser()->userID);
+ $conversationList->sqlSelects .= $sqlSelect;
$conversationList->getConditionBuilder()->add('conversation_to_user.lastVisitTime >= conversation.lastPostTime');
$conversationList->sqlLimit = (10 - $count);
$conversationList->sqlOrderBy = 'conversation.lastPostTime DESC';
* participant summary
* @var string
*/
- protected $__participantSummary = null;
+ protected $__participantSummary;
/**
* user profile object
* @var UserProfile
*/
- protected $userProfile = null;
+ protected $userProfile;
/**
* last poster's profile
* @var UserProfile
*/
- protected $lastPosterProfile = null;
+ protected $lastPosterProfile;
+
+ /**
+ * other participant's profile
+ * @var UserProfile
+ */
+ protected $otherParticipantProfile;
/**
* list of assigned labels
return $this->__participantSummary;
}
+ /**
+ * Returns the other participant's profile object.
+ *
+ * @return UserProfile
+ */
+ public function getOtherParticipantProfile() {
+ if ($this->otherParticipantProfile === null) {
+ if ($this->otherParticipantID) {
+ $this->otherParticipantProfile = UserProfileRuntimeCache::getInstance()->getObject($this->otherParticipantID);
+ }
+ else {
+ $this->otherParticipantProfile = UserProfile::getGuestUserProfile($this->otherParticipant);
+ }
+ }
+
+ return $this->otherParticipantProfile;
+ }
+
/**
* Assigns a label.
*
}
}
+.conversationItem {
+ .conversationInfo {
+ display: flex;
+ }
+
+ .conversationParticipant {
+ flex: 1 1 auto;
+ }
+ .conversationLastPostTime {
+ flex: 0 0 auto;
+ margin-left: 10px;
+ }
+}
<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->lastPosterID}
- {@$conversation->getLastPosterProfile()->getAvatar()->getImageTag(48)}
+ {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>{if $conversation->lastPosterID}<a href="{link controller='User' id=$conversation->lastPosterID title=$conversation->lastPoster}{/link}">{$conversation->lastPoster}</a>{else}{$conversation->username}{/if} <span class="separatorLeft">{@$conversation->lastPostTime|time}</span></small>
+ <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="{link controller='User' object=$participant}{/link}" class="userLink{if $participant->hideConversation == 2} conversationLeft{/if}" data-user-id="{@$participant->userID}">{$participant->username}</a>{/implode}
+ {if $participantSummaryCount < $conversation->participants}{lang}wcf.conversation.participants.other{/lang}{/if}
+ {else}
+ {if $conversation->getOtherParticipantProfile()->userID}<a href="{link controller='User' id=$conversation->getOtherParticipantProfile()->userID title=$conversation->getOtherParticipantProfile()->username}{/link}">{$conversation->getOtherParticipantProfile()->username}</a>{else}{$conversation->getOtherParticipantProfile()->username}{/if}
+ {/if}
+ {else}
+ {if $conversation->userID}<a href="{link controller='User' id=$conversation->userID title=$conversation->username}{/link}">{$conversation->username}</a>{else}{$conversation->username}{/if}
+ {/if}
+ </span>
+
+ <span class="conversationLastPostTime">{@$conversation->lastPostTime|time}</span>
+ </small>
</div>
</div>
</li>