## 2.2
### 2.2.0 Alpha 1 (XXXX-YY-ZZ)
+
+* Only search active conversation when using search bar in a conversation.
* @category Community Framework
*/
class ConversationMessageSearch extends AbstractSearchableObjectType {
+ /**
+ * id of the searched conversation
+ * @var integer
+ */
+ public $conversationID = 0;
+
/**
* message data cache
* @var array<\wcf\data\conversation\message\SearchResultConversationMessage>
*/
- public $messageCache = array();
+ public $messageCache = [];
/**
* @see \wcf\system\search\ISearchableObjectType::cacheObjects()
}
}
+ /**
+ * @see \wcf\system\search\ISearchableObjectType::getAdditionalData()
+ */
+ public function getAdditionalData() {
+ return [
+ 'conversationID' => $this->conversationID
+ ];
+ }
+
/**
* @see \wcf\system\search\ISearchableObjectType::getObject()
*/
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('conversation_to_user.hideConversation IN (0,1)');
+ if (isset($_POST['conversationID'])) {
+ $this->conversationID = intval($_POST['conversationID']);
+
+ $conditionBuilder->add('conversation.conversationID = ?', [$this->conversationID]);
+ }
+
return $conditionBuilder;
}
<item name="wcf.conversation.ownPosts"><![CDATA[Diese Konversation enthält Nachrichten von Ihnen.]]></item>
<item name="wcf.conversation.gotoLastPost"><![CDATA[Zur letzten Nachricht springen]]></item>
<item name="wcf.conversation.searchConversations"><![CDATA[Konversationen durchsuchen]]></item>
+ <item name="wcf.conversation.searchConversation"><![CDATA[Aktuelle Konversation durchsuchen]]></item>
<item name="wcf.conversation.participants.other"><![CDATA[und {if $conversation->participants - $participantSummaryCount == 1}ein weiterer{else}{#$conversation->participants-$participantSummaryCount} weitere{/if}]]></item>
<item name="wcf.conversation.attachments"><![CDATA[Diese Konversation enthält {if $conversation->attachments == 1}einen Dateianhang{else}{#$conversation->attachments} Dateianhänge{/if}.]]></item>
<item name="wcf.conversation.error.mailboxIsFull"><![CDATA[Sie haben das zulässige Limit für Konversationen bereits erreicht und können keine neuen Konversationen starten.]]></item>
<item name="wcf.conversation.ownPosts"><![CDATA[Conversation contains own messages]]></item>
<item name="wcf.conversation.gotoLastPost"><![CDATA[Jump to Last Message]]></item>
<item name="wcf.conversation.searchConversations"><![CDATA[Search Conversations]]></item>
+ <item name="wcf.conversation.searchConversation"><![CDATA[Search This Conversation Only]]></item>
<item name="wcf.conversation.participants.other"><![CDATA[and {if $conversation->participants - $participantSummaryCount == 1}one other{else}{#$conversation->participants-$participantSummaryCount} others{/if}]]></item>
<item name="wcf.conversation.attachments"><![CDATA[Conversation contains {#$conversation->attachments} attachment{if $conversation->attachments != 1}s{/if}]]></item>
<item name="wcf.conversation.error.mailboxIsFull"><![CDATA[You have reached your maximum limit of conversations and are unable to start new ones.]]></item>
<templatelistener name="searchAreaConversationSettings">
<environment>user</environment>
- <templatename>searchArea</templatename>
+ <templatename>pageHeaderSearch</templatename>
<eventname>settings</eventname>
<templatecode><![CDATA[{include file='__searchAreaConversationSettings'}]]></templatecode>
</templatelistener>
</import>
+
+ <delete>
+ <templatelistener name="searchAreaConversationSettings">
+ <environment>user</environment>
+ <templatename>searchArea</templatename>
+ <eventname>settings</eventname>
+ <templatecode><![CDATA[{include file='__searchAreaConversationSettings'}]]></templatecode>
+ </templatelistener>
+ </delete>
</data>
\ No newline at end of file
{if $__searchAreaInitialized|empty && $templateName|substr:0:12 == 'conversation'}
- {capture assign='__searchInputPlaceholder'}{lang}wcf.conversation.searchConversations{/lang}{/capture}
- {capture assign='__searchHiddenInputFields'}<input type="hidden" name="types[]" value="com.woltlab.wcf.conversation.message" />{/capture}
+ {capture assign='__searchInputPlaceholder'}{if $conversation|isset}{lang}wcf.conversation.searchConversation{/lang}{else}{lang}wcf.conversation.searchConversations{/lang}{/if}{/capture}
+ {capture assign='__searchHiddenInputFields'}<input type="hidden" name="types[]" value="com.woltlab.wcf.conversation.message" />{if $conversation|isset}<input type="hidden" name="conversationID" value="{@$conversation->conversationID}" />{/if}{/capture}
{assign var='__searchAreaInitialized' value=true}
-{/if}
\ No newline at end of file
+{/if}