Commit 3db7aa18 authored by Dominik George's avatar Dominik George

New upstream version 0.14.2~rc6

parent b6d00b2c
0.14.2rc5
0.14.2rc6
......@@ -10,19 +10,23 @@ class ContactData extends Base
{
$this->addjs('contactdata.js');
$this->addcss('contactdata.css');
$this->registerEvent('vcard_get_handle', 'onVcardReceived');
$this->registerEvent('vcard4_get_handle', 'onVcardReceived');
$this->registerEvent('vcard_get_handle', 'onVcardReceived', 'contact');
$this->registerEvent('vcard4_get_handle', 'onVcardReceived', 'contact');
}
public function onVcardReceived($packet)
{
$contact = $packet->content;
$this->rpc('MovimTpl.fill', '#'.cleanupId($contact->jid) . '_contact_data', $this->prepareData($contact->jid));
$this->rpc('MovimTpl.fill', '#'.cleanupId($contact->id) . '_contact_data', $this->prepareData($contact->id));
$this->rpc('Notification_ajaxGet');
}
public function prepareData($jid)
{
if (!$this->validateJid($jid)) {
return;
}
$view = $this->tpl();
$view->assign('message', $this->user->messages()
......
MovimWebsocket.attach(function() {
Notification.current('contact');
var parts = MovimUtils.urlParts();
if (parts.params.length > 0) {
ContactData_ajaxRefresh(parts.params[0]);
......
......@@ -14,8 +14,8 @@ class ContactHeader extends Base
public function load()
{
$this->registerEvent('roster_additem_handle', 'onUpdate');
$this->registerEvent('roster_updateitem_handle', 'onUpdate');
$this->registerEvent('roster_removeitem_handle', 'onUpdate');
$this->registerEvent('roster_updateitem_handle', 'onUpdate', 'contact');
$this->registerEvent('roster_removeitem_handle', 'onUpdate', 'contact');
}
public function onUpdate($packet)
......@@ -86,6 +86,10 @@ class ContactHeader extends Base
public function prepareHeader($jid)
{
if (!$this->validateJid($jid)) {
return;
}
$view = $this->tpl();
$view->assign('roster', ($this->user->session->contacts()->where('jid', $jid)->first()));
$view->assign('contact', App\Contact::firstOrNew(['id' => $jid]));
......
......@@ -35,10 +35,7 @@ class Notifications extends Base
public function onInvitations($from = false)
{
if (is_string($from)) {
$contact = App\Contact::find($from);
if (!$contact) {
$contact = new App\Contact(['id' => $from]);
}
$contact = App\Contact::firstOrNew(['id' => $from]);
Notification::append(
'invite|'.$from,
......
......@@ -7,7 +7,7 @@
<ul class="tabs narrow">
{loop="$packs"}
<li onclick="Stickers_ajaxShow('{$jid}', '{$value}')">
<a href="#"><img alt=":sticker:" class="emoji medium" src="{$path}/{$value}/icon.png"></a>
<a href="#"><img alt=":sticker:" class="emoji medium" src="/stickers/{$value}/icon.png"></a>
</li>
{/loop}
<li onclick="Stickers_ajaxSmiley('{$jid}')" class="active">
......
......@@ -80,7 +80,7 @@ class CreateReactionsTable extends Migration
$table->timestamps();
$table->foreign('message_mid')->references('mid')
->on('messages')->onDelete('cascade');
->on('messages')->onDelete('cascade');
$table->unique(['message_mid', 'jidfrom', 'emoji']);
});
......
ProxyPass /movim/ws/ ws://localhost:8080/
Alias /movim/ /usr/share/movim/
Alias /movim/ /usr/share/movim/public/
<Directory /usr/share/movim/>
<Directory /usr/share/movim/public/>
DirectoryIndex index.php
Options +FollowSymLinks -Indexes
AllowOverride FileInfo Options
......
location /movim/ {
alias /usr/share/movim/public/;
add_header Access-Control-Allow-Origin *;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
......@@ -11,12 +15,4 @@ location /movim/ {
proxy_set_header Connection "Upgrade";
include proxy_params;
}
location /movim/log/ {
deny all;
}
location /movim/cache/ {
deny all;
}
}
......@@ -37,7 +37,12 @@ class Core implements MessageComponentInterface
if (file_exists(CACHE_PATH . 'socketapi.sock')) {
unlink(CACHE_PATH . 'socketapi.sock');
}
array_map('unlink', glob(PUBLIC_CACHE_PATH . '*'));
array_map('unlink', array_merge(
glob(PUBLIC_CACHE_PATH . '*.css'),
glob(PUBLIC_CACHE_PATH . '*.js')
));
$this->registerCleaner();
}
......
......@@ -109,16 +109,16 @@ class Session
'exec php linker.php ' . $this->sid,
null,
[
'sid' => $this->sid,
'baseuri' => $this->baseuri,
'language' => $this->language,
'offset' => $this->offset,
'verbose' => $this->verbose,
'debug' => $this->debug,
'key' => $this->key,
'port' => $this->port
]
);
'sid' => $this->sid,
'baseuri' => $this->baseuri,
'language' => $this->language,
'offset' => $this->offset,
'verbose' => $this->verbose,
'debug' => $this->debug,
'key' => $this->key,
'port' => $this->port
]
);
$this->process->start($loop);
// The linker died, we close properly the session
......
<?php
/*-
* Copyright © 2018
* mirabilos <thorsten.glaser@teckids.org>
* Copyright © 2018, 2019
* mirabilos <thorsten.glaser@teckids.org>
*
* Provided that these terms and disclaimer and all copyright notices
* are retained or reproduced in an accompanying document, permission
......@@ -66,10 +66,9 @@ class Emoji
public function replace($string, bool $noTitle = false): string
{
$this->_string = $string;
$this->_lastEmoji = null;
return preg_replace_callback($this->_regex, function ($matches) use ($noTitle) {
$this->_lastEmoji = $matches[0];
$astext = implode(
'-',
array_map(
......@@ -82,6 +81,7 @@ class Emoji
return $matches[0];
}
$this->_lastEmoji = $matches[0];
$this->_lastEmojiURL = BASE_URI . 'theme/img/emojis/svg/' . $astext . '.svg';
$dom = new \DOMDocument('1.0', 'UTF-8');
......
......@@ -21,7 +21,7 @@
# Needs the Debian packages mksh and unicode-data installed.
cd "$(dirname "$0")"
srcpath=../../../theme/img/emojis/svg
srcpath=../../../public/theme/img/emojis/svg
cd "$srcpath"
set -A files -- *.svg
......
😁 replace-test.php
<?php
namespace App;
define('BASE_URI', '(base)');
mb_internal_encoding("UTF-8");
class Configuration
{
public $theme = '(theme)';
public static function findOrNew()
{
return new Configuration;
}
}
require_once '../Emoji.php';
$text = file_get_contents('php://stdin');
......
#!/bin/mksh
#-
# Copyright © 2018
# Copyright © 2018, 2019
# mirabilos <thorsten.glaser@teckids.org>
#
# Provided that these terms and disclaimer and all copyright notices
......@@ -19,19 +19,43 @@
# of said person’s immediate fault when using the work as intended.
cd "$(dirname "$0")"
srcpath=../../../theme/img/emojis/svg
srcpath=../../../public/theme/img/emojis/svg
saveIFS=$IFS
cd "$srcpath"
allfiles=1
set -A files -- *.svg
cd "$OLDPWD"
if [[ -n $1 ]]; then
allfiles=0
set -A files -- "$@"
print -ru2 -- "W: only testing $# files from command line"
fi
for f in "${files[@]}"; do
for f in "${files[@]}" -; do
if [[ $f = - ]]; then
if (( !allfiles )); then
# skip if only testing files from command line
print -r -- 'print "-\n~\n";'
break
fi
cat <<\EOF
print "-\n";
no warnings 'nonchar';
my $i = 0x0020 - 1;
while (++$i <= 0x10FFFF) {
# skip (relevant) non-characters
next if ($i & 0xFFFE) == 0xFFFE;
# skip surrogates
$i = 0xE000 if $i == 0xD800;
# output characters not used by the SVGs
printf("<%04X>=%c\n", $i, $i) unless exists($h{$i});
}
print "~\n";
EOF
break
fi
x=${f%.svg}
IFS=-
set -A y -- $x
......@@ -40,22 +64,60 @@ for f in "${files[@]}"; do
for z in "${y[@]}"; do
s+="\\x{$z}"
done
print -r -- "$s\\n\";"
print -r -- "$s\\n\"; \$h{0x${y[0]}}=1;"
done | perl -C7 | php replace-test.php |&
n=-1
rv=0
match=0
mis=0
cpnt=0
cnot=0
function out {
print -ru2 -- "I: $match/${#files[*]} matched, $mis mismatched"
(( allfiles )) && print -ru2 -- "I: $cnot/$cpnt codepoints (expectedly) did not match, $((cpnt-cnot)) mistakenly matched"
(( rv & 1 )) && print -ru2 -- "E: some files did not match"
(( rv & 2 )) && print -ru2 -- "E: incomplete processing of first half"
(( rv & 4 )) && print -ru2 -- "E: some codepoints mistakenly matched"
(( rv & 8 )) && print -ru2 -- "E: incomplete processing of second half"
(( rv )) || if (( allfiles )); then
print -ru2 -- "I: all files matched, all others didn’t ⇒ all OK"
else
print -ru2 -- "I: all files to be tested matched"
fi
exit $rv
}
print -nu2 -- "N: processing SVGs…\\r"
while IFS= read -pr line; do
[[ $line = '-' ]] && break
if [[ $line = '<img'*"/svg/${files[++n]}\""*\> ]]; then
let ++match
continue
fi
print -ru2 -- "W: file ${files[n]} not matched"
[[ -n $1 ]] && print -ru2 -- "N: line: $line"
rv=1
(( allfiles )) || print -ru2 -- "N: line: $line"
(( rv |= 1 ))
let ++mis
done
(( rv )) || print -ru2 -- "I: all files matched"
print -ru2 -- "I: $match/${#files[*]} matched, $mis mismatched"
exit $rv
if [[ $line != '-' ]]; then
(( rv |= 2 ))
out
fi
i=0
while IFS= read -pr line; do
if [[ $line = '~' ]]; then
read -pr x && print -ru2 -- "E: data after end of input: $x"
break
fi
let ++cpnt
(( i++ & 4095 )) || print -nu2 -- "N: processing ${line%%=*}\\r"
if [[ $line = *'<img'* ]]; then
print -ru2 -- "W: mistaken match for codepoint $line"
else
let ++cnot
fi
done
if [[ $line != '~' ]]; then
(( rv |= 8 ))
out
fi
out
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment