Browse Source

Fix XMPP URI handling in Share

pull/1443/head
Timothée Jaussoin 4 months ago
parent
commit
d3fda3b580
  1. 1
      CHANGELOG.md
  2. 1
      app/Widgets/Chat/Chat.php
  3. 8
      app/Widgets/Chat/_chat_header.tpl
  4. 2
      app/Widgets/Share/Share.php
  5. 9
      app/Widgets/Share/share.js
  6. 10
      src/Movim/XMPPUri.php

1
CHANGELOG.md

@ -16,6 +16,7 @@ v0.30.1 (master)
* Refactor the Ad-Hoc widget and move it into the contacts and MUCs drawers
* Fix #1437 Generalize the instance nickname usage on the public blog and syndication feed, add a warning message if the instance nickname is changed
* Rename the config page to configuration
* Fix XMPP URI handling in Share
v0.30
---------------------------

1
app/Widgets/Chat/Chat.php

@ -519,6 +519,7 @@ class Chat extends \Movim\Widget\Base
}
} else {
$this->rpc('RoomsUtils_ajaxAdd', $room);
$this->ajaxHttpGetEmpty();
}
}

8
app/Widgets/Chat/_chat_header.tpl

@ -31,7 +31,7 @@
{/if}
</span>
{if="$conference->isGroupChat()"}
{if="$conference && $conference->isGroupChat()"}
{if="$conference && $conference->info && $conference->info->related"}
{$related = $conference->info->related}
<span
@ -43,7 +43,7 @@
{/if}
{/if}
{if="$conference->mujiCalls->isEmpty() && $conference->isGroupChat()"}
{if="$conference && $conference->mujiCalls->isEmpty() && $conference->isGroupChat()"}
<span class="control icon active {if="$incall"}disabled{/if}" onclick="Visio_ajaxGetMujiLobby('{$conference->conference}', true, true);">
<i class="material-symbols">videocam</i>
</span>
@ -59,7 +59,7 @@
</span>
<div>
{if="$conference->mujiCalls->isNotEmpty()"}
{if="$conference && $conference->mujiCalls->isNotEmpty()"}
{if="$muji = $conference->currentMuji()"}
<button class="button oppose color red"
onclick="Visio_ajaxLeaveMuji('{$muji->id}')">
@ -113,7 +113,7 @@
</span>
{/if}
{if="$conference->info && $conference->isGroupChat() && $conference->subject && $conference->info->name"}
{if="$conference && $conference->info && $conference->isGroupChat() && $conference->subject && $conference->info->name"}
<span class="second">•</span>
{/if}

2
app/Widgets/Share/Share.php

@ -15,7 +15,7 @@ class Share extends Base
$this->addjs('share.js');
}
public function ajaxGet($link)
public function ajaxHttpGet($link)
{
$validateUrl = Validator::url();

9
app/Widgets/Share/share.js

@ -2,8 +2,13 @@ var Share = {
get: function() {
var parts = MovimUtils.urlParts();
if (parts.params[0]) {
document.querySelector('h4').innerHTML = atob(parts.params[0]);
Share_ajaxGet(atob(parts.params[0]));
console.log(parts.params[0]);
uri = parts.params[0].substr(0, 5) == 'xmpp:'
? parts.params[0]
: atob(parts.params[0]);
document.querySelector('h4').innerHTML = uri;
Share_ajaxHttpGet(uri);
}
},
redirect: function(url) {

10
src/Movim/XMPPUri.php

@ -23,7 +23,7 @@ class XMPPUri
if (isset($this->uri['query'])) {
if ($this->uri['query'] == 'join') {
$this->type = 'room';
$this->params = $this->uri['path'];
$this->params = [$this->uri['path']];
}
$queryParams = explodeQueryParams($this->uri['query']);
@ -66,24 +66,26 @@ class XMPPUri
case 'room':
return Route::urlize(
'chat',
[$this->params, 'room']
[$this->params[0], 'room']
);
break;
case 'post':
return Route::urlize(
'post',
[$this->params]
$this->params
);
break;
case 'contact':
return Route::urlize(
'contact',
[$this->params]
$this->params
);
break;
}
return null;
}
public function getPost(): ?Post

Loading…
Cancel
Save