From e2af267fb71daaa817de2787cda27403c0d1e5a2 Mon Sep 17 00:00:00 2001
From: src386
- {$c->__('about.translators_text')} www.transifex.com/projects/p/movim/
+ Thanks to all the translators translations.launchpad.net/movim
{$contact->description}
'.$contentimg;
if(!isset($this->commentplace))
- $this->__set('commentplace', $this->origin);
+ $this->commentplace = $this->origin;
- $this->__set('content', trim($content));
- //$this->__set('contentcleaned', prepareString(html_entity_decode($this->content)));
- $purifier = new \HTMLPurifier();
- $this->contentcleaned = $purifier->purify(html_entity_decode($this->content));
+ $this->content = trim($content);
+ $this->contentcleaned = prepareString(html_entity_decode($this->content));
if($entry->entry->geoloc) {
if($entry->entry->geoloc->lat != 0)
- $this->__set('lat', (string)$entry->entry->geoloc->lat);
+ $this->lat = (string)$entry->entry->geoloc->lat;
if($entry->entry->geoloc->lon != 0)
- $this->__set('lon', (string)$entry->entry->geoloc->lon);
+ $this->lon = (string)$entry->entry->geoloc->lon;
}
}
diff --git a/sources/app/models/presence/Presence.php b/sources/app/models/presence/Presence.php
index 0f64f7a..002e785 100644
--- a/sources/app/models/presence/Presence.php
+++ b/sources/app/models/presence/Presence.php
@@ -4,23 +4,23 @@ namespace Modl;
class Presence extends Model {
protected $id;
-
+
protected $session;
protected $jid;
-
+
// General presence informations
protected $resource;
protected $value;
protected $priority;
protected $status;
-
+
// Client Informations
protected $node;
protected $ver;
-
+
// Delay - XEP 0203
protected $delay;
-
+
// Last Activity - XEP 0256
protected $last;
@@ -33,84 +33,84 @@ class Presence extends Model {
// vcard-temp:x:update, not saved in the DB
public $photo = false;
-
+
public function __construct() {
$this->_struct = '
{
- "id" :
+ "id" :
{"type":"string", "size":128, "mandatory":true },
- "session" :
+ "session" :
{"type":"string", "size":64, "mandatory":true, "key":true },
- "jid" :
+ "jid" :
{"type":"string", "size":64, "mandatory":true, "key":true },
- "resource" :
+ "resource" :
{"type":"string", "size":64, "key":true },
- "value" :
+ "value" :
{"type":"int", "size":11, "mandatory":true },
- "priority" :
+ "priority" :
{"type":"int", "size":11 },
- "status" :
+ "status" :
{"type":"text"},
- "node" :
+ "node" :
{"type":"string", "size":128 },
- "ver" :
+ "ver" :
{"type":"string", "size":128 },
- "delay" :
+ "delay" :
{"type":"date"},
- "last" :
+ "last" :
{"type":"int", "size":11 },
- "publickey" :
+ "publickey" :
{"type":"text"},
- "muc" :
+ "muc" :
{"type":"int", "size":1 },
- "mucjid" :
+ "mucjid" :
{"type":"string", "size":64 },
- "mucaffiliation" :
+ "mucaffiliation" :
{"type":"string", "size":32 },
- "mucrole" :
+ "mucrole" :
{"type":"string", "size":32 }
}';
-
+
parent::__construct();
}
-
+
public function setPresence($stanza) {
$jid = explode('/',(string)$stanza->attributes()->from);
-
+
if($stanza->attributes()->to)
$to = current(explode('/',(string)$stanza->attributes()->to));
else
$to = $jid[0];
- $this->__set('session', $to);
- $this->__set('jid', $jid[0]);
+ $this->session = $to;
+ $this->jid = $jid[0];
if(isset($jid[1]))
- $this->__set('resource', $jid[1]);
+ $this->resource = $jid[1];
else
- $this->__set('resource', 'default');
-
- $this->__set('status', (string)$stanza->status);
-
+ $this->resource = 'default';
+
+ $this->status = (string)$stanza->status;
+
if($stanza->c) {
- $this->__set('node', (string)$stanza->c->attributes()->node);
- $this->__set('ver', (string)$stanza->c->attributes()->ver);
+ $this->node = (string)$stanza->c->attributes()->node;
+ $this->ver = (string)$stanza->c->attributes()->ver;
}
-
+
if($stanza->priority)
- $this->__set('priority', (string)$stanza->priority);
-
+ $this->priority = (string)$stanza->priority;
+
if((string)$stanza->attributes()->type == 'error') {
- $this->__set('value', 6);
+ $this->value = 6;
} elseif((string)$stanza->attributes()->type == 'unavailable') {
- $this->__set('value', 5);
+ $this->value = 5;
} elseif((string)$stanza->show == 'away') {
- $this->__set('value', 2);
+ $this->value = 2;
} elseif((string)$stanza->show == 'dnd') {
- $this->__set('value', 3);
+ $this->value = 3;
} elseif((string)$stanza->show == 'xa') {
- $this->__set('value', 4);
+ $this->value = 4;
} else {
- $this->__set('value', 1);
+ $this->value = 1;
}
// Specific XEP
@@ -118,41 +118,41 @@ class Presence extends Model {
foreach($stanza->children() as $name => $c) {
switch($c->attributes()->xmlns) {
case 'jabber:x:signed' :
- $this->__set('publickey', (string)$c);
+ $this->publickey = (string)$c;
break;
case 'http://jabber.org/protocol/muc#user' :
- $this->__set('muc ', true);
+ $this->muc = true;
if($c->item->attributes()->jid)
- $this->__set('mucjid', cleanJid((string)$c->item->attributes()->jid));
+ $this->mucjid = cleanJid((string)$c->item->attributes()->jid);
else
- $this->__set('mucjid', (string)$stanza->attributes()->from);
+ $this->mucjid = (string)$stanza->attributes()->from;
- $this->__set('mucrole', (string)$c->item->attributes()->role);
- $this->__set('mucaffiliation', (string)$c->item->attributes()->affiliation);
+ $this->mucrole = (string)$c->item->attributes()->role;
+ $this->mucaffiliation = (string)$c->item->attributes()->affiliation;
break;
case 'vcard-temp:x:update' :
- $this->__set('photo', true);
+ $this->photo = true;
break;
}
}
}
-
+
if($stanza->delay) {
- $this->__set('delay',
+ $this->delay =
gmdate(
- 'Y-m-d H:i:s',
+ 'Y-m-d H:i:s',
strtotime(
(string)$stanza->delay->attributes()->stamp
)
)
- );
+ ;
}
-
+
if($stanza->query) {
- $this->__set('last', (int)$stanza->query->attributes()->seconds);
+ $this->last = (int)$stanza->query->attributes()->seconds;
}
}
-
+
public function getPresence() {
$txt = array(
1 => 'online',
@@ -162,7 +162,7 @@ class Presence extends Model {
5 => 'offline',
6 => 'server_error'
);
-
+
$arr = array();
$arr['jid'] = $this->jid;
$arr['resource'] = $this->resource;
@@ -172,7 +172,7 @@ class Presence extends Model {
$arr['status'] = $this->status;
$arr['node'] = $this->node;
$arr['ver'] = $this->ver;
-
+
return $arr;
}
diff --git a/sources/app/models/rosterlink/RosterLink.php b/sources/app/models/rosterlink/RosterLink.php
index 61595da..2668c41 100644
--- a/sources/app/models/rosterlink/RosterLink.php
+++ b/sources/app/models/rosterlink/RosterLink.php
@@ -2,57 +2,56 @@
namespace modl;
-class RosterLink extends Model {
+class RosterLink extends Model {
public $session;
public $jid;
-
- protected $rostername;
+
+ public $rostername;
public $rosterask;
public $rostersubscription;
-
- protected $realname;
-
- protected $groupname;
-
+
+ public $realname;
+
+ public $groupname;
+
public $chaton;
public $publickey;
-
+
public function __construct() {
$this->_struct = '
{
- "session" :
+ "session" :
{"type":"string", "size":128, "mandatory":true, "key":true },
- "jid" :
+ "jid" :
{"type":"string", "size":128, "mandatory":true, "key":true },
- "rostername" :
+ "rostername" :
{"type":"string", "size":128 },
- "rosterask" :
+ "rosterask" :
{"type":"string", "size":128 },
- "rostersubscription" :
+ "rostersubscription" :
{"type":"string", "size":128 },
- "realname" :
+ "realname" :
{"type":"string", "size":128 },
- "groupname" :
+ "groupname" :
{"type":"string", "size":128 },
- "chaton" :
+ "chaton" :
{"type":"int", "size":11 }
}';
-
+
parent::__construct();
}
-
+
function set($stanza) {
$this->jid = (string)$stanza->attributes()->jid;
-
- if(isset($stanza->attributes()->name)
- && (string)$stanza->attributes()->name != '')
- $this->__set('rostername', (string)$stanza->attributes()->name);
+
+ if(isset($stanza->attributes()->name) && (string)$stanza->attributes()->name != '')
+ $this->rostername = (string)$stanza->attributes()->name;
else
- $this->__set('rostername', (string)$stanza->attributes()->jid);
- $this->__set('rosterask', (string)$stanza->attributes()->ask);
- $this->__set('rostersubscription', (string)$stanza->attributes()->subscription);
- $this->__set('groupname', (string)$stanza->group);
+ $this->rostername = (string)$stanza->attributes()->jid;
+ $this->rosterask = (string)$stanza->attributes()->ask;
+ $this->rostersubscription = (string)$stanza->attributes()->subscription;
+ $this->groupname = (string)$stanza->group;
}
}
diff --git a/sources/app/models/subscription/Subscription.php b/sources/app/models/subscription/Subscription.php
index 6dd273f..6fe980d 100644
--- a/sources/app/models/subscription/Subscription.php
+++ b/sources/app/models/subscription/Subscription.php
@@ -4,11 +4,11 @@ namespace modl;
class Subscription extends Model {
public $jid;
- protected $server;
- protected $node;
- protected $subscription;
- protected $subid;
- protected $title;
+ public $server;
+ public $node;
+ public $subscription;
+ public $subid;
+ public $title;
public $description;
public $tags;
public $timestamp;
@@ -40,13 +40,13 @@ class Subscription extends Model {
}
function set($jid, $server, $node, $s) {
- $this->__set('jid', $jid);
- $this->__set('server', $server);
- $this->__set('node', $node);
- $this->__set('jid', (string)$s->attributes()->jid);
- $this->__set('subscription', (string)$s->attributes()->subscription);
- $this->__set('subid', (string)$s->attributes()->subid);
- $this->__set('tags', serialize(array()));
+ $this->jid = $jid;
+ $this->server = $server;
+ $this->node = $node;
+ $this->jid = (string)$s->attributes()->jid;
+ $this->subscription = (string)$s->attributes()->subscription;
+ $this->subid = (string)$s->attributes()->subid;
+ $this->tags = serialize(array());
if($this->subid = '')
$this->subid = 'default';
diff --git a/sources/app/views/about.tpl b/sources/app/views/about.tpl
index 61f570c..51f4f82 100644
--- a/sources/app/views/about.tpl
+++ b/sources/app/views/about.tpl
@@ -5,7 +5,6 @@
widget('Tabs');?>
widget('About');?>
- widget('Help');?>
widget('Caps');?>
diff --git a/sources/app/views/page.tpl b/sources/app/views/page.tpl
index f11aaac..34e897c 100644
--- a/sources/app/views/page.tpl
+++ b/sources/app/views/page.tpl
@@ -11,8 +11,8 @@
-
+
+
diff --git a/sources/app/widgets/About/about.tpl b/sources/app/widgets/About/about.tpl
index 60e2226..5e33396 100644
--- a/sources/app/widgets/About/about.tpl
+++ b/sources/app/widgets/About/about.tpl
@@ -20,7 +20,7 @@
{$c->__('about.translators')}
-
+
{if="$dbconnected"}
{if="$dbinfos > 0"}
{if="isset($attachements.links)"}
{loop="$attachements.links"}
- {if="substr($value.href, 0, 5) != 'xmpp:' && filter_var($value.href, FILTER_VALIDATE_URL)"}
+ {if="substr($value.href, 0, 5) != 'xmpp:'"}
diff --git a/sources/app/widgets/Bookmark/Bookmark.php b/sources/app/widgets/Bookmark/Bookmark.php
index 324200c..ade02b8 100644
--- a/sources/app/widgets/Bookmark/Bookmark.php
+++ b/sources/app/widgets/Bookmark/Bookmark.php
@@ -30,6 +30,10 @@ class Bookmark extends WidgetBase
{
$this->addcss('bookmark.css');
$this->registerEvent('bookmark', 'onBookmark');
+ $this->registerEvent('bookmarkerror', 'onBookmarkError');
+
+ //$this->registerEvent('mucrole', 'onMucRole');
+
$this->registerEvent('groupsubscribed', 'onGroupSubscribed');
$this->registerEvent('groupunsubscribed', 'onGroupUnsubscribed');
}
@@ -124,6 +128,16 @@ class Bookmark extends WidgetBase
RPC::call('movim_fill', 'bookmarks', $html);
Notification::append(null, $this->__('bookmarks.updated'));
}
+ /*
+ function onMucRole($arr)
+ {
+
+ }
+ */
+ function onBookmarkError($error)
+ {
+ Notification::append(null, $this->__('bookmarks.error').$error);
+ }
function ajaxGetBookmark()
{
diff --git a/sources/app/widgets/Chat/Chat.php b/sources/app/widgets/Chat/Chat.php
index a85bcde..85ee764 100644
--- a/sources/app/widgets/Chat/Chat.php
+++ b/sources/app/widgets/Chat/Chat.php
@@ -253,7 +253,7 @@ class Chat extends WidgetBase
}
$m->body = rawurldecode($message);
- //$m->html = prepareString($m->body, false, true);
+ $m->html = prepareString($m->body, false, true);
$m->published = gmdate('Y-m-d H:i:s');
$m->delivered = gmdate('Y-m-d H:i:s');
@@ -265,7 +265,7 @@ class Chat extends WidgetBase
$p = new Publish;
$p->setTo($to);
//$p->setHTML($m->html);
- $p->setContent($m->body);
+ $p->setContent(htmlspecialchars($m->body));
if($muc) {
$p->setMuc();
@@ -488,10 +488,7 @@ class Chat extends WidgetBase
if(isset($message->html)) {
$message->body = $message->html;
} else {
- // We add some smileys...
- $message->convertEmojis();
- $message->addUrls();
- // $message->body = prepareString(htmlentities($message->body , ENT_COMPAT,'UTF-8'));
+ $message->body = prepareString(htmlentities($message->body , ENT_COMPAT,'UTF-8'));
}
if($message->type == 'groupchat') {
diff --git a/sources/app/widgets/Chat/chat.js b/sources/app/widgets/Chat/chat.js
index cfb7785..afa727d 100644
--- a/sources/app/widgets/Chat/chat.js
+++ b/sources/app/widgets/Chat/chat.js
@@ -77,6 +77,7 @@ var Chat = {
};
bubble.querySelector('span.user').innerHTML = message.resource;
+
var conversation = document.getElementById(id);
if(conversation) {
conversation.appendChild(bubble);
@@ -109,7 +110,6 @@ var Chat = {
if(bubble) {
bubble.querySelector('div.bubble div').innerHTML = message.body;
-
bubble.querySelector('div.bubble span.info').innerHTML = message.published;
movim_append(id, bubble.outerHTML);
diff --git a/sources/app/widgets/Config/Config.php b/sources/app/widgets/Config/Config.php
index 61bdddc..4ce56a4 100644
--- a/sources/app/widgets/Config/Config.php
+++ b/sources/app/widgets/Config/Config.php
@@ -36,9 +36,7 @@ class Config extends WidgetBase
/* We load the user configuration */
$this->user->reload();
- $l = Locale::start();
-
- $view->assign('languages', $l->getList());
+ $view->assign('languages', loadLangArray());
$view->assign('me', $this->user->getLogin());
$view->assign('conf', $this->user->getConfig());
diff --git a/sources/app/widgets/Contact/Contact.php b/sources/app/widgets/Contact/Contact.php
index 35eac2c..392a3b5 100644
--- a/sources/app/widgets/Contact/Contact.php
+++ b/sources/app/widgets/Contact/Contact.php
@@ -271,6 +271,26 @@ class Contact extends WidgetBase
}
}
+ function getLastFM($contact)
+ {
+ $uri = str_replace(
+ ' ',
+ '%20',
+ 'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=80c1aa3abfa9e3d06f404a2e781e38f9&artist='.
+ $contact->tuneartist.
+ '&album='.
+ $contact->tunesource.
+ '&format=json'
+ );
+
+ $json = json_decode(requestURL($uri, 2));
+
+ $img = $json->album->image[2]->{'#text'};
+ $url = $json->album->url;
+
+ return array($img, $url);
+ }
+
/**
* @brief Validate the jid
*
diff --git a/sources/app/widgets/Contact/_contact.tpl b/sources/app/widgets/Contact/_contact.tpl
index 04eb608..8e86ab6 100644
--- a/sources/app/widgets/Contact/_contact.tpl
+++ b/sources/app/widgets/Contact/_contact.tpl
@@ -131,6 +131,14 @@
{$contact->description}
-{$contact->tunetitle}
{/if} diff --git a/sources/app/widgets/Group/Group.php b/sources/app/widgets/Group/Group.php index ceccc87..24da6e0 100644 --- a/sources/app/widgets/Group/Group.php +++ b/sources/app/widgets/Group/Group.php @@ -196,6 +196,10 @@ class Group extends WidgetBase $view->assign('node', $node); $html .= $view->draw('_group_publish', true); + $header = $this->prepareHeader($server, $node); + + Header::fill($header); + RPC::call('MovimTpl.fill', '#group_widget.'.stringToUri($server.'_'.$node), $html); RPC::call('Group.enableVideos'); } @@ -278,14 +282,14 @@ class Group extends WidgetBase ->request(); } - function ajaxGetSubscriptions($server, $node, $notify = true) + function ajaxGetSubscriptions($server, $node) { if(!$this->validateServerNode($server, $node)) return; $r = new GetSubscriptions; $r->setTo($server) ->setNode($node) - ->setNotify($notify) + ->setSync() ->request(); } diff --git a/sources/app/widgets/Group/_group_header.tpl b/sources/app/widgets/Group/_group_header.tpl index 51c9ecf..769fbbc 100644 --- a/sources/app/widgets/Group/_group_header.tpl +++ b/sources/app/widgets/Group/_group_header.tpl @@ -54,7 +54,7 @@{if="$value->getContact()->getTrueName() != ''"} @@ -49,7 +47,7 @@
{$value->content} diff --git a/sources/app/widgets/Groups/groups.js b/sources/app/widgets/Groups/groups.js index 89011b3..1cda0c9 100644 --- a/sources/app/widgets/Groups/groups.js +++ b/sources/app/widgets/Groups/groups.js @@ -10,7 +10,7 @@ var Groups = { 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_ajaxGetSubscriptions(this.dataset.server, this.dataset.node, false); + //Group_ajaxGetSubscriptions(this.dataset.server, this.dataset.node); Groups.reset(items); movim_add_class(this, 'active'); } diff --git a/sources/app/widgets/Help/help.tpl b/sources/app/widgets/Help/help.tpl index a8325a4..0ec9ed5 100644 --- a/sources/app/widgets/Help/help.tpl +++ b/sources/app/widgets/Help/help.tpl @@ -32,7 +32,7 @@
{$c->__('chatroom.button')}
movim@conference.movim.eu