Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-09-15 15:58:40 +0300
committerJoas Schilling <coding@schilljs.com>2020-09-15 17:33:58 +0300
commitbbe65e5b82d1e8cf0641e793689e745df8e6cdad (patch)
treed9a41b41283b21119c1016f640d2e40a42e4001a /lib/Search
parentadd7d0aa09d12b8d16d4a7097e626910a86fc383 (diff)
Store the one-to-one users in the "name" column so we can reuse the data
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Search')
-rw-r--r--lib/Search/ConversationSearch.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/Search/ConversationSearch.php b/lib/Search/ConversationSearch.php
index fec37fc68..6db88d459 100644
--- a/lib/Search/ConversationSearch.php
+++ b/lib/Search/ConversationSearch.php
@@ -100,16 +100,27 @@ class ConversationSearch implements IProvider {
continue;
}
- if (stripos($room->getName(), $query->getTerm()) === false &&
- stripos($room->getDisplayName($user->getUID()), $query->getTerm()) === false) {
- // Neither name nor displayname (one-to-one) match, skip
- continue;
+ if ($room->getType() === Room::ONE_TO_ONE_CALL) {
+ $otherUserId = str_replace(
+ json_encode($user->getUID()),
+ '',
+ $room->getName()
+ );
+ if (stripos($otherUserId, $query->getTerm()) === false
+ && stripos($room->getDisplayName($user->getUID()), $query->getTerm()) === false) {
+ // Neither name nor displayname (one-to-one) match, skip
+ continue;
+ }
+ } else {
+ if (stripos($room->getName(), $query->getTerm()) === false) {
+ continue;
+ }
}
$icon = '';
$iconClass = '';
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
- $users = $room->getParticipantUserIds();
+ $users = json_decode($room->getName(), true);
foreach ($users as $participantId) {
if ($participantId !== $user->getUID()) {
$icon = $this->url->linkToRouteAbsolute('core.avatar.getAvatar', [