Browse Source

- Hide notification when an encrypted message is published

- Fix little CSS issues
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
dec59cef60
  1. 9
      app/widgets/Chat/Chat.php
  2. 4
      app/widgets/ServerNodes/ServerNodes.php
  3. 4
      themes/movim/css/template.css

9
app/widgets/Chat/Chat.php

@ -24,6 +24,8 @@ use Moxl\Xec\Action\Presence\Unavaiable;
class Chat extends WidgetBase { class Chat extends WidgetBase {
private $_encrypted = false;
function load() { function load() {
$this->addcss('chat.css'); $this->addcss('chat.css');
$this->addjs('chat.js'); $this->addjs('chat.js');
@ -76,6 +78,7 @@ class Chat extends WidgetBase {
private function checkEncrypted($message) { private function checkEncrypted($message) {
if(preg_match("#^\?OTR#", $message->body)) { if(preg_match("#^\?OTR#", $message->body)) {
$this->_encrypted = true;
$message->body = $this->__('message.encrypted'); $message->body = $this->__('message.encrypted');
} }
@ -98,13 +101,17 @@ class Chat extends WidgetBase {
$message = $this->checkEncrypted($message); $message = $this->checkEncrypted($message);
if($contact!=null && $message->session != $message->jidfrom) {
if($contact != null
&& $message->session != $message->jidfrom
&& $this->_encrypted == false) {
RPC::call( RPC::call(
'notify', 'notify',
$contact->getTrueName(), $contact->getTrueName(),
$message->body, $message->body,
$contact->getPhoto('m')); $contact->getPhoto('m'));
} }
$this->_encrypted = false;
if($contact != null && $contact->chaton == 0) { if($contact != null && $contact->chaton == 0) {
$contact->chaton = 2; $contact->chaton = 2;

4
app/widgets/ServerNodes/ServerNodes.php

@ -120,9 +120,9 @@ class ServerNodes extends WidgetCommon
} }
$html .= ' $html .= '
<li>
<li class="block">
<a '.$url.'>'. <a '.$url.'>'.
$i->getName().
'<span class="content">'.$i->getName().'</span>'.
$tags.' $tags.'
</a> </a>
</li>'; </li>';

4
themes/movim/css/template.css

@ -32,6 +32,10 @@
width: 100%; width: 100%;
} }
.block:nth-of-type(even) {
padding-right: 0.5em;
}
} }
@media screen and (max-width: 1024px) { @media screen and (max-width: 1024px) {

Loading…
Cancel
Save