Browse Source

Notify with the correct nickname when receiving MUC PM

Update the dependencies
pull/1065/head
Timothée Jaussoin 3 years ago
parent
commit
b56620313e
  1. 10
      app/widgets/Chat/Chat.php
  2. 12
      composer.lock

10
app/widgets/Chat/Chat.php

@ -158,10 +158,18 @@ class Chat extends \Movim\Widget\Base
$roster = $this->user->session->contacts()->where('jid', $from)->first();
$chatStates->clearState($from);
$name = $roster ? $roster->truename : $contact->truename;
// Specific case where the message is a MUC PM
$jid = explodeJid($message->jidfrom);
if ($jid['username'] == $name && $jid['resource'] == $message->resource) {
$name = $message->resource;
}
Notification::rpcCall('Notification.incomingMessage');
Notification::append(
'chat|'.$from,
$roster ? $roster->truename : $contact->truename,
$name,
$message->encrypted && is_array($message->omemoheader)
? "🔒 " . substr($message->omemoheader['payload'], 0, strlen($message->omemoheader['payload'])/2)
: $rawbody,

12
composer.lock

@ -1502,16 +1502,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.4.3",
"version": "7.4.4",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab"
"reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab",
"reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8",
"reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8",
"shasum": ""
},
"require": {
@ -1606,7 +1606,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.4.3"
"source": "https://github.com/guzzle/guzzle/tree/7.4.4"
},
"funding": [
{
@ -1622,7 +1622,7 @@
"type": "tidelift"
}
],
"time": "2022-05-25T13:24:33+00:00"
"time": "2022-06-09T21:39:15+00:00"
},
{
"name": "guzzlehttp/promises",

Loading…
Cancel
Save