Browse Source

- Merge with edhelas

pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
5b858c2fe3
  1. 6
      app/widgets/Chat/Chat.php
  2. 5
      app/widgets/Chat/_chat.tpl
  3. 2
      app/widgets/Chats/Chats.php
  4. 2
      app/widgets/Contact/Contact.php
  5. 1
      app/widgets/Group/Group.php
  6. 2
      app/widgets/Groups/groups.js
  7. 10
      linker.php

6
app/widgets/Chat/Chat.php

@ -505,17 +505,15 @@ class Chat extends WidgetBase
*/
private function validateJid($jid)
{
$validate_jid = Validator::email()->noWhitespace()->length(6, 60);
$validate_jid = Validator::string()->noWhitespace()->length(6, 60);
if(!$validate_jid->validate($jid)) return false;
else return true;
}
function display()
{
$validate_jid = Validator::email()->length(6, 40);
$this->view->assign('jid', false);
if($validate_jid->validate($this->get('f'))) {
if($this->validateJid($this->get('f'))) {
$this->view->assign('jid', $this->get('f'));
}
}

5
app/widgets/Chat/_chat.tpl

@ -10,7 +10,7 @@
<span class="icon gray emojis_open" onclick="Chat_ajaxSmiley()">
{$c->ajaxSmileyGet('😃')}
</span>
<div class="action" onclick="Chat.sendMessage('{$jid}', {if="$muc"}true{else}false{/if})">
<div class="action" data-jid="{$jid}" onclick="Chat.sendMessage('this.dataset.jid', {if="$muc"}true{else}false{/if})">
<i class="md md-send"></i>
</div>
<form>
@ -18,10 +18,11 @@
<textarea
rows="1"
id="chat_textarea"
data-jid="{$jid}"
onkeypress="
if(event.keyCode == 13) {
state = 0;
Chat.sendMessage('{$jid}', {if="$muc"}true{else}false{/if});
Chat.sendMessage(this.dataset.jid, {if="$muc"}true{else}false{/if});
return false;
} else {
{if="!$muc"}

2
app/widgets/Chats/Chats.php

@ -171,7 +171,7 @@ class Chats extends WidgetBase
private function validateJid($jid)
{
$validate_jid = Validator::email()->noWhitespace()->length(6, 40);
$validate_jid = Validator::string()->noWhitespace()->length(6, 40);
if($validate_jid->validate($jid)) return true;
else return false;

2
app/widgets/Contact/Contact.php

@ -267,7 +267,7 @@ class Contact extends WidgetBase
*/
private function validateJid($jid)
{
$validate_jid = Validator::email()->noWhitespace()->length(6, 60);
$validate_jid = Validator::string()->noWhitespace()->length(6, 60);
if(!$validate_jid->validate($jid)) return false;
else return true;
}

1
app/widgets/Group/Group.php

@ -45,7 +45,6 @@ class Group extends WidgetBase
list($server, $node) = array_values($packet->content);
$this->displayItems($server, $node);
//$this->ajaxGetAffiliations($server, $node);
RPC::call('Group.clearLoad');
RPC::call('MovimTpl.showPanel');

2
app/widgets/Groups/groups.js

@ -9,7 +9,7 @@ var Groups = {
MovimTpl.scrollPanelTop();
Group_ajaxGetItems(this.dataset.server, this.dataset.node);
Group_ajaxGetMetadata(this.dataset.server, this.dataset.node);
//Group_ajaxGetAffiliations(this.dataset.server, this.dataset.node);
Group_ajaxGetAffiliations(this.dataset.server, this.dataset.node);
//Group_ajaxGetSubscriptions(this.dataset.server, this.dataset.node);
Groups.reset(items);
movim_add_class(this, 'active');

10
linker.php

@ -80,12 +80,14 @@ $stdin_behaviour = function ($data) use (&$conn, $loop, &$buffer, &$connector, &
if(!empty($xml) && $conn) {
$conn->write(trim($xml));
//$conn->send(trim($xml));
#fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
}
}
} else {
$buffer .= $data;
}
$loop->tick();
};
$xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$stdin, $stdin_behaviour, $parser) {
@ -115,8 +117,8 @@ $xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$s
$restart = true;
}
#fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
#fwrite(STDERR, colorize(getenv('sid'), 'yellow')." widgets : ".\sizeToCleanSize(memory_get_usage())."\n");
fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
fwrite(STDERR, colorize(getenv('sid'), 'yellow')." widgets : ".\sizeToCleanSize(memory_get_usage())."\n");
\Moxl\API::clear();
\RPC::clear();
@ -147,7 +149,7 @@ $xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$s
if(!empty($xml)) {
$conn->write(trim($xml));
//$conn->send(trim($xml));
#fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
}
}

Loading…
Cancel
Save