Commit f409cd91 authored by Dominik George's avatar Dominik George

New upstream version 0.14.1~rc4

parent e97952db
......@@ -15,6 +15,10 @@ v0.14.1 (trunk)
* Add a close button to the Drawer widget
* Errors and Exceptions handling improvements
* Fix connection using utf8mb4 on MySQL
* Update the log system for a simpler one
* Display Gateway connection status
* CSS fixes in Forms
* Disable the dropdown in Form if there is only one choice
v0.14
---------------------------
......
0.14.1rc
\ No newline at end of file
0.14.1rc4
\ No newline at end of file
......@@ -56,7 +56,7 @@ class Capability extends Model
foreach ($this->getFeaturesAttribute() as $feature) {
preg_match("/http:\/\/jabber.org\/protocol\/pubsub#(.*)-affiliation$/", $feature, $matches);
if (!empty($matches)){
if (!empty($matches)) {
$roles[$matches[1]] = __('affiliation.' . $matches[1]);
}
}
......
......@@ -141,13 +141,13 @@ class Contact extends Model
$this->description = trim((string)$vcard->note->text);
}
public function getPlace()
public function getPlace(): string
{
$place = null;
$place = '';
if ($this->loctext != '')
if ($this->loctext != '') {
$place .= $this->loctext.' ';
else {
} else {
if ($this->locbuilding != '')
$place .= $this->locbuilding.' ';
if ($this->locstreet != '')
......@@ -165,7 +165,7 @@ class Contact extends Model
return $place;
}
public function getTruenameAttribute()
public function getTruenameAttribute(): string
{
if ($this->fn) return $this->fn;
if ($this->nickname) return $this->nickname;
......@@ -174,12 +174,12 @@ class Contact extends Model
return explodeJid($this->id)['username'];
}
public function getJidAttribute()
public function getJidAttribute(): string
{
return $this->id;
}
function getAge()
public function getAge()
{
if ($this->isValidDate()) {
$age = intval(substr(date('Ymd') - date('Ymd', strtotime($this->date)), 0, -4));
......@@ -203,7 +203,7 @@ class Contact extends Model
cleanupId($this->groupname);
}
function isEmpty()
public function isEmpty(): bool
{
$this->isValidDate();
......@@ -215,7 +215,7 @@ class Contact extends Model
&& $this->description == null);
}
function isValidDate()
public function isValidDate(): bool
{
if (isset($this->date)
&& $this->date != '0000-00-00T00:00:00+0000'
......@@ -228,12 +228,12 @@ class Contact extends Model
return false;
}
function isFromMuc()
public function isFromMuc(): bool
{
return strpos($this->jid, '/') !== false;
}
function isOld()
public function isOld(): bool
{
return (strtotime($this->updated) < mktime( // We update the 1 day old vcards
gmdate("H"),
......@@ -246,7 +246,7 @@ class Contact extends Model
);
}
function isMe()
public function isMe(): bool
{
return ($this->id == \App\User::me()->id);
}
......
......@@ -111,6 +111,16 @@ class Info extends Model
}
}
/**
* Only for gateways
*/
public function getPresenceAttribute()
{
return \App\User::me()->session->presences
->where('jid', $this->attributes['server'])
->first();
}
public function set($query)
{
$from = (string)$query->attributes()->from;
......@@ -163,7 +173,7 @@ class Info extends Model
}
if (isset($query->query->x)) {
foreach($query->query->x->field as $field) {
foreach ($query->query->x->field as $field) {
$key = (string)$field->attributes()->var;
switch ($key) {
case 'pubsub#title':
......@@ -190,42 +200,42 @@ class Info extends Model
case 'abuse-addresses':
$arr = [];
foreach($field->children() as $value) {
foreach ($field->children() as $value) {
$arr[] = (string)$value;
}
$this->abuseaddresses = $arr;
break;
case 'admin-addresses':
$arr = [];
foreach($field->children() as $value) {
foreach ($field->children() as $value) {
$arr[] = (string)$value;
}
$this->adminaddresses = $arr;
break;
case 'feedback-addresses':
$arr = [];
foreach($field->children() as $value) {
foreach ($field->children() as $value) {
$arr[] = (string)$value;
}
$this->feedbackaddresses = $arr;
break;
case 'sales-addresses':
$arr = [];
foreach($field->children() as $value) {
foreach ($field->children() as $value) {
$arr[] = (string)$value;
}
$this->salesaddresses = $arr;
break;
case 'security-addresses':
$arr = [];
foreach($field->children() as $value) {
foreach ($field->children() as $value) {
$arr[] = (string)$value;
}
$this->securityaddresses = $arr;
break;
case 'support-addresses':
$arr = [];
foreach($field->children() as $value) {
foreach ($field->children() as $value) {
$arr[] = (string)$value;
}
$this->supportaddresses = $arr;
......
......@@ -323,6 +323,8 @@ class Message extends Model
public function addUrls()
{
$this->body = addUrls($this->body);
if (is_string($this->body)) {
$this->body = addUrls($this->body);
}
}
}
......@@ -259,7 +259,7 @@ class Post extends Model
{
$content = '';
foreach($contents as $c) {
foreach ($contents as $c) {
switch($c->attributes()->type) {
case 'html':
case 'xhtml':
......@@ -289,7 +289,7 @@ class Post extends Model
private function extractTitle($titles)
{
$title = '';
foreach($titles as $t) {
foreach ($titles as $t) {
switch($t->attributes()->type) {
case 'html':
case 'xhtml':
......@@ -372,7 +372,7 @@ class Post extends Model
if ($tag->name == 'nsfw') $this->nsfw = true;
} else {
foreach($entry->entry->category as $cat) {
foreach ($entry->entry->category as $cat) {
$tag = \App\Tag::firstOrCreateSafe([
'name' => strtolower((string)$cat->attributes()->term)
]);
......@@ -387,7 +387,7 @@ class Post extends Model
// Extract more tags if possible
$tagsContent = getHashtags(htmlspecialchars($this->title))
+ getHashtags(htmlspecialchars($this->contentraw));
foreach($tagsContent as $tag) {
foreach ($tagsContent as $tag) {
$tag = \App\Tag::firstOrCreateSafe([
'name' => strtolower((string)$tag)
]);
......@@ -440,7 +440,7 @@ class Post extends Model
$results = $xml->xpath('//a');
if (is_array($results) && !empty($results)) {
foreach($results as $link) {
foreach ($results as $link) {
$link->addAttribute('target', '_blank');
}
}
......@@ -465,7 +465,7 @@ class Post extends Model
{
$picture = false;
foreach($links as $attachment) {
foreach ($links as $attachment) {
$enc = (array)$attachment->attributes();
$enc = $enc['@attributes'];
......
......@@ -117,7 +117,8 @@ class Presence extends Model
if ((string)$stanza->attributes()->type == 'error') {
$this->value = 6;
} elseif ((string)$stanza->attributes()->type == 'unavailable') {
} elseif ((string)$stanza->attributes()->type == 'unavailable'
|| (string)$stanza->attributes()->type == 'unsubscribed') {
$this->value = 5;
} elseif ((string)$stanza->show == 'away') {
$this->value = 2;
......
......@@ -18,7 +18,7 @@
* position : 'down',
* type : 'circle',
* animation : 'slide',
* dataUrl: function(url){},
* dataUrl: function(url) {},
* win: top
* });
*/
......@@ -355,7 +355,7 @@
var newImg = document.createElement('img');
var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
newImg.setAttribute('crossOrigin', 'anonymous');
newImg.onload=function(){
newImg.onload=function() {
_context.clearRect(0, 0, _w, _h);
_context.drawImage(newImg, 0, 0, _w, _h);
link.setIcon(_canvas);
......@@ -857,4 +857,3 @@
}
})();
......@@ -21,7 +21,7 @@ var MovimAvatar = {
var image = new Image();
image.src = src;
image.onload = function(){
image.onload = function() {
ctx = canvas.getContext("2d");
switch (orientation) {
......
......@@ -70,7 +70,7 @@ var MovimWebsocket = {
console.log("Connection established!");
MovimWebsocket.attempts = 1;
MovimWebsocket.launchAttached();
setTimeout(function(){
setTimeout(function() {
MovimWebsocket.ping();
}, 10000);
};
......@@ -85,7 +85,7 @@ var MovimWebsocket = {
if (obj.func == 'started') {
// If the linker was started but we're not on the login page
if (!['login', 'account', 'accountnext'].includes(MovimUtils.urlParts().page)) {
if (!['login', 'account', 'accountnext', 'tag'].includes(MovimUtils.urlParts().page)) {
MovimUtils.disconnect();
} else {
MovimWebsocket.launchStarted();
......@@ -180,7 +180,7 @@ var MovimWebsocket = {
)
);
setTimeout(function(){
setTimeout(function() {
if (MovimWebsocket.pong == false) {
MovimWebsocket.connection.onerror();
} else {
......
......@@ -4,12 +4,12 @@ use Movim\Controller\Base;
class AboutController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.about'));
}
......
......@@ -3,12 +3,12 @@ use Movim\Controller\Base;
class AccountController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
requestAPI('disconnect', 2, ['sid' => SESSION_ID]);
......
<?php
use Movim\Controller\Base;
class AccountnextController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.account_creation'));
}
......
<?php
use Movim\Controller\Base;
class AdminController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
session_start();
......
......@@ -5,12 +5,12 @@ use App\Configuration;
class AdminloginController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.administration'));
......
<?php
use Movim\Controller\Base;
class BlogController extends Base
{
function load()
public function load()
{
$this->session_only = false;
$this->public = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.blog'));
$this->page->disableJavascriptCheck();
......
<?php
use Movim\Controller\Base;
class ChatController extends Base
{
function load()
public function load()
{
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.chats'));
}
......
......@@ -4,12 +4,12 @@ use Movim\Controller\Base;
class CommunityController extends Base
{
function load()
public function load()
{
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.communities'));
......
<?php
use Movim\Controller\Base;
class ConfController extends Base
{
function load()
public function load()
{
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.configuration'));
}
......
......@@ -4,12 +4,12 @@ use Movim\Controller\Base;
class ContactController extends Base
{
function load()
public function load()
{
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.contacts'));
......
......@@ -6,12 +6,12 @@ use Movim\Session;
class DisconnectController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
// Just in case
requestAPI('disconnect', 2, ['sid' => SESSION_ID]);
......
<?php
use Movim\Controller\Base;
class FeedController extends Base
{
function load()
public function load()
{
$this->session_only = false;
$this->raw = true;
}
function dispatch()
public function dispatch()
{
}
}
<?php
use Movim\Controller\Base;
class HelpController extends Base
{
function load()
public function load()
{
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.help'));
}
......
<?php
use Movim\Controller\Base;
class InfosController extends Base
{
function load()
public function load()
{
header('Content-type: application/json');
$this->session_only = false;
$this->raw = true;
}
function dispatch()
public function dispatch()
{
}
}
......@@ -5,12 +5,12 @@ use Respect\Validation\Validator;
class LoginController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.login'));
......
......@@ -5,12 +5,12 @@ use Movim\User;
class NewsController extends Base
{
function load()
public function load()
{
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.news'));
......
......@@ -4,13 +4,13 @@ use Movim\Controller\Base;
class NodeController extends Base
{
function load()
public function load()
{
$this->session_only = false;
$this->public = true;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.communities'));
$this->page->disableJavascriptCheck();
......
......@@ -4,12 +4,12 @@ use Movim\Controller\Base;
class NotfoundController extends Base
{
function load()
public function load()
{
$this->session_only = false;
}
function dispatch()
public function dispatch()
{
$this->page->setTitle(__('page.not_found'));
$this->page->disableJavascriptCheck();
......
<?php
use Movim\Controller\Base;
class PictureController extends Base
{
function load()
public function load()
{
$this->session_only = true;
$this->raw = true;
}
function dispatch()
public function dispatch()
{
}
}
......@@ -4,13 +4,13 @@ use Movim\Controller\Base;
class PopuptestController extends Base
{
function load()
public function load()
{
$this->unique = true;
$this->session_only = true;
}
function dispatch()
public function dispatch()
{
}
}