Browse Source

Hide links to Contact profile if it's a MUC contact, fix #571

pull/684/head
Timothée Jaussoin 7 years ago
parent
commit
bdb3523098
  1. 5
      app/Contact.php
  2. 8
      app/widgets/Chat/_chat.tpl
  3. 10
      app/widgets/ContactActions/_contactactions_drawer.tpl

5
app/Contact.php

@ -228,6 +228,11 @@ class Contact extends Model
return false;
}
function isFromMuc()
{
return strpos($this->jid, '/') !== false;
}
function isOld()
{
return (strtotime($this->updated) < mktime( // We update the 1 day old vcards

8
app/widgets/Chat/_chat.tpl

@ -159,9 +159,11 @@
</li>
</ul>
<ul class="list context_menu active">
<li onclick="MovimUtils.reload('{$c->route('contact', $contact->jid)}')">
<p class="normal">{$c->__('chat.profile')}</p>
</li>
{if="!$contact->isFromMuc()"}
<li onclick="MovimUtils.reload('{$c->route('contact', $contact->jid)}')">
<p class="normal">{$c->__('chat.profile')}</p>
</li>
{/if}
<li class="on_mobile" onclick="Chat.editPrevious()">
<p class="normal">{$c->__('chat.edit_previous')}</p>
</li>

10
app/widgets/ContactActions/_contactactions_drawer.tpl

@ -15,16 +15,18 @@
">
<img src="{$url}">
</span>
{else}
{elseif="!$contact->isFromMuc()"}
<span class="primary icon bubble color {$contact->id|stringToColor}
{if="$roster && $roster->presence"}status {$roster->presence->presencekey}{/if}
">
<i class="material-icons">person</i>
</span>
{/if}
<span class="control icon active" onclick="MovimUtils.reload('{$c->route('contact', $contact->id)}')">
<i class="material-icons">person</i>
</span>
{if="!$contact->isFromMuc()"}
<span class="control icon active" onclick="MovimUtils.reload('{$c->route('contact', $contact->id)}')">
<i class="material-icons">person</i>
</span>
{/if}
{if="!$contact->isMe()"}
<span class="control icon active" onclick="ContactActions_ajaxChat('{$contact->id}')">
<i class="material-icons">comment</i>

Loading…
Cancel
Save