зеркало из https://github.com/nextcloud/spreed.git
Show name for bridged messages
Signed-off-by: Gary Kim <gary@garykim.dev>
This commit is contained in:
Родитель
a1550d1989
Коммит
aaf51b70b2
|
@ -77,6 +77,8 @@ class MessageParser {
|
|||
if ($comment->getActorType() === Attendee::ACTOR_USERS) {
|
||||
$user = $this->userManager->get($comment->getActorId());
|
||||
$displayName = $user instanceof IUser ? $user->getDisplayName() : $comment->getActorId();
|
||||
} elseif ($comment->getActorType() === Attendee::ACTOR_BRIDGED) {
|
||||
$displayName = $comment->getActorId();
|
||||
} elseif ($comment->getActorType() === Attendee::ACTOR_GUESTS) {
|
||||
if (isset($guestNames[$comment->getActorId()])) {
|
||||
$displayName = $this->guestNames[$comment->getActorId()];
|
||||
|
|
|
@ -160,6 +160,9 @@ class ChatController extends AEnvironmentAwareController {
|
|||
if ($actorDisplayName) {
|
||||
$this->guestManager->updateName($this->room, $this->participant, $actorDisplayName);
|
||||
}
|
||||
} else if ($this->userId === MatterbridgeManager::BRIDGE_BOT_USERID) {
|
||||
$actorType = Attendee::ACTOR_BRIDGED;
|
||||
$actorId = str_replace(["/", "\""], "", $actorDisplayName);
|
||||
} else {
|
||||
$actorType = Attendee::ACTOR_USERS;
|
||||
$actorId = $this->userId;
|
||||
|
|
|
@ -387,6 +387,7 @@ class MatterbridgeManager {
|
|||
$serverUrl = $part['server'];
|
||||
} else {
|
||||
$serverUrl = preg_replace('/\/+$/', '', $this->urlGenerator->getAbsoluteURL(''));
|
||||
$content .= " SeparateDisplayName = true" ."\n";
|
||||
// TODO remove that
|
||||
//$serverUrl = preg_replace('/https:/', 'http:', $serverUrl);
|
||||
}
|
||||
|
@ -394,7 +395,7 @@ class MatterbridgeManager {
|
|||
$content .= sprintf(' Login = "%s"', $part['login']) . "\n";
|
||||
$content .= sprintf(' Password = "%s"', $part['password']) . "\n";
|
||||
$content .= ' PrefixMessagesWithNick = true' . "\n";
|
||||
$content .= ' RemoteNickFormat="[{PROTOCOL}] <{NICK}> "' . "\n\n";
|
||||
$content .= ' RemoteNickFormat="[{PROTOCOL}] <{NICK}>"' . "\n\n";
|
||||
} elseif ($type === 'mattermost') {
|
||||
// remove protocol from server URL
|
||||
if (preg_match('/^https?:/', $part['server'])) {
|
||||
|
|
|
@ -58,6 +58,7 @@ class Attendee extends Entity {
|
|||
public const ACTOR_GUESTS = 'guests';
|
||||
public const ACTOR_EMAILS = 'emails';
|
||||
public const ACTOR_CIRCLES = 'circles';
|
||||
public const ACTOR_BRIDGED = 'bridged';
|
||||
|
||||
public const PUBLISHING_PERMISSIONS_NONE = 0;
|
||||
public const PUBLISHING_PERMISSIONS_AUDIO = 1;
|
||||
|
|
|
@ -54,6 +54,7 @@ export const ATTENDEE = {
|
|||
GROUPS: 'groups',
|
||||
CIRCLES: 'circles',
|
||||
BOTS: 'bots',
|
||||
BRIDGED: 'bridged',
|
||||
},
|
||||
BRIDGE_BOT_ID: 'bridge-bot',
|
||||
CHANGELOG_BOT_ID: 'changelog',
|
||||
|
|
Загрузка…
Ссылка в новой задаче