code:
<?php
/**
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2011, StatusNet, Inc.
 *
 * Superclass for microapp plugin
 *
 * PHP version 5
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  Microapp
 * @package   StatusNet
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2011 StatusNet, Inc.
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
 * @link      http://status.net/
 */

if (!defined('STATUSNET')) {
    // This check helps protect against security problems;
    // your code file can't be executed directly from the web.
    exit(1);
}

/**
 * Superclass for microapp plugins
 *
 * This class lets you define micro-applications with different kinds of activities.
 *
 * The applications work more-or-less like other
 *
 * @category  Microapp
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2011 StatusNet, Inc.
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
 * @link      http://status.net/
 */
abstract class MicroAppPlugin extends ActivityHandlerPlugin
{
    /**
     * Returns a localized string which represents this micro-app,
     * to be shown to users selecting what type of post to make.
     * This is paired with the key string in $this->tag().
     *
     * All micro-app classes must override this method.
     *
     * @return string
     */
    abstract function appTitle();

    /**
     * When building the primary notice form, we'll fetch also some
     * alternate forms for specialized types -- that's you!
     *
     * Return a custom Widget or Form object for the given output
     * object, and it'll be included in the HTML output. Beware that
     * your form may be initially hidden.
     *
     * All micro-app classes must override this method.
     *
     * @param HTMLOutputter $out
     * @return Widget
     */
    abstract function entryForm($out);

    /**
     *
     */
    public function newFormAction() {
        // such as 'newbookmark' or 'newevent' route
        return 'new'.$this->tag();
    }

    /**
     * Output the HTML for this kind of object in a list
     *
     * @param NoticeListItem $nli The list item being shown.
     *
     * @return boolean hook value
     */
    function onStartShowNoticeItem(NoticeListItem $nli)
    {
        if (!$this->isMyNotice($nli->notice)) {
            return true;
        }

        // Legacy use was creating a "NoticeListItemAdapter", but
        // nowadays we solve that using event handling for microapps.
        // This section will remain until all plugins are fixed.
        $adapter = $this->adaptNoticeListItem($nli) ?: $nli;

        $adapter->showNotice();
        $adapter->showNoticeAttachments();
        $adapter->showNoticeFooter();

        return false;
    }

    /**
     * Given a notice list item, returns an adapter specific
     * to this plugin.
     *
     * @param NoticeListItem $nli item to adapt
     *
     * @return NoticeListItemAdapter adapter or null
     */
    function adaptNoticeListItem($nli)
    {
      return null;
    }

    function onStartShowEntryForms(&$tabs)
    {
        $tabs[$this->tag()] = array('title' => $this->appTitle(),
                                    'href'  => common_local_url($this->newFormAction()),
                                   );
        return true;
    }

    function onStartMakeEntryForm($tag, $out, &$form)
    {
        if ($tag == $this->tag()) {
            $form = $this->entryForm($out);
            return false;
        }

        return true;
    }
}


code:
<?php
// This file is part of GNU social - https://www.gnu.org/software/social
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GNU social is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.

defined('GNUSOCIAL') || die();

/**
 * Base class for modules
 *
 * A base class for GNU social modules. Mostly a light wrapper around
 * the Event framework.
 *
 * Subclasses of Module will automatically handle an event if they define
 * a method called "onEventName". (Well, OK -- only if they call parent::__construct()
 * in their constructors.)
 *
 * They will also automatically handle the InitializeModule and CleanupModule with the
 * initialize() and cleanup() methods, respectively.
 *
 * @category Module
 * @package  GNUsocial
 * @author   Evan Prodromou <evan@status.net>
 * @copyright 2010-2019 Free Software Foundation, Inc http://www.fsf.org
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 *
 * @see      Event
 */
class Module
{
    public function __construct()
    {
        // Load Module settings
        foreach (common_config(static::class) as $aname => $avalue) {
            $this->$aname = $avalue;
        }

        Event::addHandler('InitializeModule', [$this, 'initialize']);
        Event::addHandler('CleanupModule', [$this, 'cleanup']);

        foreach (get_class_methods($this) as $method) {
            if (mb_substr($method, 0, 2) == 'on') {
                Event::addHandler(mb_substr($method, 2), [$this, $method]);
            }
        }

        $this->setupGettext();
    }

    public function initialize()
    {
        return true;
    }

    public function cleanup()
    {
        return true;
    }

    /**
     * Load related components when needed
     *
     * Most non-trivial plugins will require extra components to do their work. Typically
     * these include data classes, action classes, widget classes, or external libraries.
     *
     * This method receives a class name and loads the PHP file related to that class. By
     * tradition, action classes typically have files named for the action, all lower-case.
     * Data classes are in files with the data class name, initial letter capitalized.
     *
     * Note that this method will be called for *all* overloaded classes, not just ones
     * in this plugin! So, make sure to return true by default to let other plugins, and
     * the core code, get a chance.
     *
     * @param string $cls Name of the class to be loaded
     *
     * @return bool hook value; true means continue processing, false means stop.
     */
    public function onAutoload($cls)
    {
        $cls = basename($cls);
        $basedir = INSTALLDIR . '/modules/' . mb_substr(get_called_class(), 0, -6);

        $file = null;

        if (preg_match('/^(\w+)(Action|Form)$/', $cls, $type)) {
            $type = array_map('strtolower', $type);
            $file = "{$basedir}/{$type[2]}s/{$type[1]}.php";
        }
        if (!file_exists($file)) {
            $file = "{$basedir}/classes/{$cls}.php";

            // library files can be put into subdirs ('_'->'/' conversion)
            // such as LRDDMethod_WebFinger -> lib/lrddmethod/webfinger.php
            if (!file_exists($file)) {
                $type = strtolower($cls);
                $type = str_replace('_', '/', $type);
                $file = "{$basedir}/lib/{$type}.php";
            }
        }

        if (!is_null($file) && file_exists($file)) {
            require_once $file;
            return false;
        }

        return true;
    }

    /**
     * Checks if this plugin has localization that needs to be set up.
     * Gettext localizations can be called via the _m() helper function.
     */
    protected function setupGettext()
    {
        $class = get_class($this);
        if (substr($class, -6) == 'Module') {
            $name = substr($class, 0, -6);
            $path = common_config('plugins', 'locale_path');
            if (!$path) {
                // @fixme this will fail for things installed in local/plugins
                // ... but then so will web links so far.
                $path = INSTALLDIR . "/modules/{$name}/locale";
            }
            if (file_exists($path) && is_dir($path)) {
                bindtextdomain($name, $path);
                bind_textdomain_codeset($name, 'UTF-8');
            }
        }
    }

    protected function log($level, $msg)
    {
        common_log($level, get_class($this) . ': ' . $msg);
    }

    protected function debug($msg)
    {
        $this->log(LOG_DEBUG, $msg);
    }

    public function name()
    {
        $cls = get_class($this);
        return mb_substr($cls, 0, -6);
    }

    public function version()
    {
        return GNUSOCIAL_VERSION;
    }

    protected function userAgent()
    {
        return HTTPClient::userAgent()
            . ' (' . get_class($this) . ' v' . $this->version() . ')';
    }

    public function onModuleVersion(array &$versions): bool
    {
        $name = $this->name();

        $versions[] = [
            'name' => $name,
            // TRANS: Displayed as version information for a plugin if no version information was found.
            'version' => _m('Unknown')
        ];

        return true;
    }

    public static function staticPath($module, $relative)
    {
        if (GNUsocial::useHTTPS()) {
            $server = common_config('plugins', 'sslserver');
        } else {
            $server = common_config('plugins', 'server');
        }

        if (empty($server)) {
            if (GNUsocial::useHTTPS()) {
                $server = common_config('site', 'sslserver');
            }
            if (empty($server)) {
                $server = common_config('site', 'server');
            }
        }

        if (GNUsocial::useHTTPS()) {
            $path = common_config('plugins', 'sslpath');
        } else {
            $path = common_config('plugins', 'path');
        }

        if (empty($path)) {
            $path = common_config('site', 'path') . '/modules/';
        }

        if ($path[strlen($path) - 1] != '/') {
            $path .= '/';
        }

        if ($path[0] != '/') {
            $path = '/' . $path;
        }

        $protocol = GNUsocial::useHTTPS() ? 'https' : 'http';

        return $protocol . '://' . $server . $path . $module . '/' . $relative;
    }

    public function path($relative)
    {
        return self::staticPath($this->name(), $relative);
    }
}

repo_name: ksuudilla/gnu

license: mit


code:
<?php
// This file is part of GNU social - https://www.gnu.org/software/social
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GNU social is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.

defined('GNUSOCIAL') || die();

/**
 * Base class for plugins
 *
 * A base class for GNU social plugin. Mostly a light wrapper around
 * the Event framework.
 *
 * Subclasses of Plugin will automatically handle an event if they define
 * a method called "onEventName". (Well, OK -- only if they call parent::__construct()
 * in their constructors.)
 *
 * They will also automatically handle the InitializePlugin and CleanupPlugin with the
 * initialize() and cleanup() methods, respectively.
 *
 * @category Module
 * @package  GNUsocial
 * @author   Evan Prodromou <evan@status.net>
 * @copyright 2010-2019 Free Software Foundation, Inc http://www.fsf.org
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 *
 * @see      Event
 */
class Plugin extends Module
{
    public function __construct()
    {
        Event::addHandler('InitializePlugin', [$this, 'initialize']);
        Event::addHandler('CleanupPlugin', [$this, 'cleanup']);

        foreach (get_class_methods($this) as $method) {
            if (mb_substr($method, 0, 2) == 'on') {
                Event::addHandler(mb_substr($method, 2), [$this, $method]);
            }
        }

        $this->setupGettext();
    }

    public function initialize()
    {
        return true;
    }

    public function cleanup()
    {
        return true;
    }

    /**
     * Load related components when needed
     *
     * Most non-trivial plugins will require extra components to do their work. Typically
     * these include data classes, action classes, widget classes, or external libraries.
     *
     * This method receives a class name and loads the PHP file related to that class. By
     * tradition, action classes typically have files named for the action, all lower-case.
     * Data classes are in files with the data class name, initial letter capitalized.
     *
     * Note that this method will be called for *all* overloaded classes, not just ones
     * in this plugin! So, make sure to return true by default to let other plugins, and
     * the core code, get a chance.
     *
     * @param string $cls Name of the class to be loaded
     *
     * @return bool hook value; true means continue processing, false means stop.
     */
    public function onAutoload($cls)
    {
        $cls = basename($cls);
        $basedir = INSTALLDIR . '/local/plugins/' . mb_substr(get_called_class(), 0, -6);
        if (!file_exists($basedir)) {
            $basedir = INSTALLDIR . '/plugins/' . mb_substr(get_called_class(), 0, -6);
        }

        $file = null;

        if (preg_match('/^(\w+)(Action|Form)$/', $cls, $type)) {
            $type = array_map('strtolower', $type);
            $file = "{$basedir}/{$type[2]}s/{$type[1]}.php";
        }
        if (!file_exists($file)) {
            $file = "{$basedir}/classes/{$cls}.php";

            // library files can be put into subdirs ('_'->'/' conversion)
            // such as LRDDMethod_WebFinger -> lib/lrddmethod/webfinger.php
            if (!file_exists($file)) {
                $type = strtolower($cls);
                $type = str_replace('_', '/', $type);
                $file = "{$basedir}/lib/{$type}.php";
            }
        }

        if (!is_null($file) && file_exists($file)) {
            require_once $file;
            return false;
        }

        return true;
    }

    /**
     * Checks if this plugin has localization that needs to be set up.
     * Gettext localizations can be called via the _m() helper function.
     */
    protected function setupGettext()
    {
        $class = get_class($this);
        if (substr($class, -6) == 'Plugin') {
            $name = substr($class, 0, -6);
            $path = common_config('plugins', 'locale_path');
            if (!$path) {
                // @fixme this will fail for things installed in local/plugins
                // ... but then so will web links so far.
                $path = INSTALLDIR . "/plugins/{$name}/locale";
                if (!file_exists($path)) {
                    $path = INSTALLDIR . "/local/plugins/{$name}/locale";
                }
            }
            if (file_exists($path) && is_dir($path)) {
                bindtextdomain($name, $path);
                bind_textdomain_codeset($name, 'UTF-8');
            }
        }
    }

    public function onPluginVersion(array &$versions): bool
    {
        $name = $this->name();

        $versions[] = [
            'name' => $name,
            // TRANS: Displayed as version information for a plugin if no version information was found.
            'version' => _m('Unknown')
        ];

        return true;
    }

    public function onModuleVersion(array &$versions): bool
    {
        return true;
    }

    public static function staticPath($plugin, $relative)
    {
        if (GNUsocial::useHTTPS()) {
            $server = common_config('plugins', 'sslserver');
        } else {
            $server = common_config('plugins', 'server');
        }

        if (empty($server)) {
            if (GNUsocial::useHTTPS()) {
                $server = common_config('site', 'sslserver');
            }
            if (empty($server)) {
                $server = common_config('site', 'server');
            }
        }

        if (GNUsocial::useHTTPS()) {
            $path = common_config('plugins', 'sslpath');
        } else {
            $path = common_config('plugins', 'path');
        }

        if (empty($path)) {
            // XXX: extra stat().
            if (@file_exists(PUBLICDIR . '/local/plugins/' . $plugin . '/' . $relative)) {
                $path = common_config('site', 'path') . '/local/plugins/';
            } else {
                $path = common_config('site', 'path') . '/plugins/';
            }
        }

        if ($path[strlen($path) - 1] != '/') {
            $path .= '/';
        }

        if ($path[0] != '/') {
            $path = '/' . $path;
        }

        $protocol = GNUsocial::useHTTPS() ? 'https' : 'http';

        return $protocol . '://' . $server . $path . $plugin . '/' . $relative;
    }

    public function path($relative)
    {
        return self::staticPath($this->name(), $relative);
    }
}


code:
As of StatusNet 1.0.x, actual formatting of the notices is done server-side,
loaded by AJAX after the real-time notification comes in. This has the drawback
that we may make extra HTTP requests and delay incoming notices a little, but
means that formatting and internationalization is consistent.

== TODO ==
* Update mark behaviour (on notice send)
* Pause, Send a notice ~ should not update counter
* Pause ~ retain up to 50-100 most recent notices
* Make it work for Conversation page (perhaps a little tricky)
* IE is updating the counter in document title all the time (Not sure if this
  is still an issue)
* Reconsider the timestamp approach


code:
<?php
// This file is part of GNU social - https://www.gnu.org/software/social
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GNU social is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Superclass for plugins that do "real time" updates of timelines using Ajax
 *
 * @category  Plugin
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @author    Mikael Nordfeldth <mmn@hethane.se>
 * @copyright 2009-2019 Free Software Foundation, Inc http://www.fsf.org
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */

defined('GNUSOCIAL') || die();

/**
 * Superclass for plugin to do realtime updates
 *
 * Based on experience with the Comet and Meteor plugins,
 * this superclass extracts out some of the common functionality
 *
 * Currently depends on the Favorite module.
 *
 * @category Plugin
 * @package  GNUsocial
 * @author   Evan Prodromou <evan@status.net>
 * @license  https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */
class RealtimePlugin extends Plugin
{
    protected $showurl = null;

    /**
     * When it's time to initialize the plugin, calculate and
     * pass the URLs we need.
     */
    public function onInitializePlugin()
    {
        // FIXME: need to find a better way to pass this pattern in
        $this->showurl = common_local_url(
            'shownotice',
            ['notice' => '0000000000']
        );
        return true;
    }

    public function onCheckSchema()
    {
        $schema = Schema::get();
        $schema->ensureTable('realtime_channel', Realtime_channel::schemaDef());
        return true;
    }

    /**
     * Hook for RouterInitialized event.
     *
     * @param URLMapper $m path-to-action mapper
     * @return bool hook return
     * @throws Exception
     */
    public function onRouterInitialized(URLMapper $m)
    {
        $m->connect(
            'main/channel/:channelkey/keepalive',
            ['action' => 'keepalivechannel'],
            ['channelkey' => '[a-z0-9]{32}']
        );
        $m->connect(
            'main/channel/:channelkey/close',
            ['action' => 'closechannel'],
            ['channelkey' => '[a-z0-9]{32}']
        );
        return true;
    }

    public function onEndShowScripts(Action $action)
    {
        $channel = $this->_getChannel($action);

        if (empty($channel)) {
            return true;
        }

        $timeline = $this->_pathToChannel([$channel->channel_key]);

        // If there's not a timeline on this page,
        // just return true

        if (empty($timeline)) {
            return true;
        }

        $base = $action->selfUrl();
        if (mb_strstr($base, '?')) {
            $url = $base . '&realtime=1';
        } else {
            $url = $base . '?realtime=1';
        }

        $scripts = $this->_getScripts();

        foreach ($scripts as $script) {
            $action->script($script);
        }

        $user = common_current_user();

        if (!empty($user->id)) {
            $user_id = $user->id;
        } else {
            $user_id = 0;
        }

        if ($action->boolean('realtime')) {
            $realtimeUI = ' RealtimeUpdate.initPopupWindow();';
        } else {
            $pluginPath = common_path('plugins/Realtime/');
            $keepalive = common_local_url('keepalivechannel', ['channelkey' => $channel->channel_key]);
            $close = common_local_url('closechannel', ['channelkey' => $channel->channel_key]);
            $realtimeUI = ' RealtimeUpdate.initActions('.json_encode($url).', '.json_encode($timeline).', '.json_encode($pluginPath).', '.json_encode($keepalive).', '.json_encode($close).'); ';
        }

        $script = ' $(document).ready(function() { '.
          $realtimeUI.
            $this->_updateInitialize($timeline, $user_id).
          '}); ';
        $action->inlineScript($script);

        return true;
    }

    public function onEndShowStylesheets(Action $action)
    {
        $urlpath = self::staticPath(
            str_replace('Plugin', '', __CLASS__),
            'css/realtimeupdate.css'
        );
        $action->cssLink($urlpath, null, 'screen, projection, tv');
        return true;
    }

    public function onHandleQueuedNotice(Notice $notice)
    {
        $paths = [];

        // Add to the author's timeline

        try {
            $profile = $notice->getProfile();
        } catch (Exception $e) {
            $this->log(LOG_ERR, $e->getMessage());
            return true;
        }

        try {
            $user = $profile->getUser();
            $paths[] = ['showstream', $user->nickname, null];
        } catch (NoSuchUserException $e) {
            // We really should handle the remote profile views too
            $user = null;
        }

        // Add to the public timeline

        $is_local = intval($notice->is_local);
        if ($is_local === Notice::LOCAL_PUBLIC ||
                ($is_local === Notice::REMOTE && !common_config('public', 'localonly'))) {
            $paths[] = ['public', null, null];
        }

        // Add to the tags timeline

        $tags = $this->getNoticeTags($notice);

        if (!empty($tags)) {
            foreach ($tags as $tag) {
                $paths[] = ['tag', $tag, null];
            }
        }

        // Add to inbox timelines
        // XXX: do a join

        $ni = $notice->whoGets();

        foreach (array_keys($ni) as $user_id) {
            $user = User::getKV('id', $user_id);
            $paths[] = ['all', $user->getNickname(), null];
        }

        // Add to the replies timeline

        $reply = new Reply();
        $reply->notice_id = $notice->id;

        if ($reply->find()) {
            while ($reply->fetch()) {
                $user = User::getKV('id', $reply->profile_id);
                if (!empty($user)) {
                    $paths[] = ['replies', $user->getNickname(), null];
                }
            }
        }

        // Add to the group timeline
        // XXX: join

        $gi = new Group_inbox();
        $gi->notice_id = $notice->id;

        if ($gi->find()) {
            while ($gi->fetch()) {
                $ug = User_group::getKV('id', $gi->group_id);
                $paths[] = ['showgroup', $ug->getNickname(), null];
            }
        }

        if (count($paths) > 0) {
            $json = $this->noticeAsJson($notice);

            $this->_connect();

            // XXX: We should probably fan-out here and do a
            // new queue item for each path

            foreach ($paths as $path) {
                list($action, $arg1, $arg2) = $path;

                $channels = Realtime_channel::getAllChannels($action, $arg1, $arg2);
                $this->log(LOG_INFO, sprintf(
                    _("%d candidate channels for notice %d"),
                    count($channels),
                    $notice->id
                ));

                foreach ($channels as $channel) {

                    // XXX: We should probably fan-out here and do a
                    // new queue item for each user/path combo

                    if (is_null($channel->user_id)) {
                        $profile = null;
                    } else {
                        $profile = Profile::getKV('id', $channel->user_id);
                    }
                    if ($notice->inScope($profile)) {
                        $this->log(
                            LOG_INFO,
                            sprintf(
                                _m("Delivering notice %d to channel (%s, %s, %s) for user '%s'"),
                                $notice->id,
                                $channel->action,
                                $channel->arg1,
                                $channel->arg2,
                                ($profile ? $profile->getNickname() : '<public>')
                            )
                        );
                        $timeline = $this->_pathToChannel([$channel->channel_key]);
                        $this->_publish($timeline, $json);
                    }
                }
            }

            $this->_disconnect();
        }

        return true;
    }

    public function onStartShowBody(Action $action)
    {
        $realtime = $action->boolean('realtime');
        if (!$realtime) {
            return true;
        }

        $action->elementStart(
            'body',
            (common_current_user() ? [
                'id' => $action->trimmed('action'),
                'class' => 'user_in realtime-popup',
            ] : [
                'id' => $action->trimmed('action'),
                'class'=> 'realtime-popup',
            ])
        );

        // XXX hack to deal with JS that tries to get the
        // root url from page output

        $action->elementStart('address');

        if (common_config('singleuser', 'enabled')) {
            $user = User::singleUser();
            $url = common_local_url('showstream', ['nickname' => $user->nickname]);
        } else {
            $url = common_local_url('public');
        }

        $action->element(
            'a',
            ['class' => 'url',
             'href'  => $url],
            ''
        );

        $action->elementEnd('address');

        $action->showContentBlock();
        $action->showScripts();
        $action->elementEnd('body');
        return false; // No default processing
    }

    public function noticeAsJson(Notice $notice)
    {
        // FIXME: this code should be abstracted to a neutral third
        // party, like Notice::asJson(). I'm not sure of the ethics
        // of refactoring from within a plugin, so I'm just abusing
        // the ApiAction method. Don't do this unless you're me!

        $act = new ApiAction('/dev/null');

        $arr = $act->twitterStatusArray($notice, true);
        $arr['url'] = $notice->getUrl(true);
        $arr['html'] = htmlspecialchars($notice->getRendered());
        $arr['source'] = htmlspecialchars($arr['source']);
        $arr['conversation_url'] = $notice->getConversationUrl();

        $profile = $notice->getProfile();
        $arr['user']['profile_url'] = $profile->profileurl;

        // Add needed repeat data

        if (!empty($notice->repeat_of)) {
            $original = Notice::getKV('id', $notice->repeat_of);
            if ($original instanceof Notice) {
                $arr['retweeted_status']['url'] = $original->getUrl(true);
                $arr['retweeted_status']['html'] = htmlspecialchars($original->getRendered());
                $arr['retweeted_status']['source'] = htmlspecialchars($original->source);
                $originalProfile = $original->getProfile();
                $arr['retweeted_status']['user']['profile_url'] = $originalProfile->profileurl;
                $arr['retweeted_status']['conversation_url'] = $original->getConversationUrl();
            }
            unset($original);
        }

        return $arr;
    }

    public function getNoticeTags(Notice $notice)
    {
        $tags = null;

        $nt = new Notice_tag();
        $nt->notice_id = $notice->id;

        if ($nt->find()) {
            $tags = [];
            while ($nt->fetch()) {
                $tags[] = $nt->tag;
            }
        }

        $nt->free();
        $nt = null;

        return $tags;
    }

    public function _getScripts(): array
    {
        $urlpath = self::staticPath(
            str_replace('Plugin', '', __CLASS__),
            'js/realtimeupdate.js'
        );
        return [$urlpath];
    }

    /**
     * Export any i18n messages that need to be loaded at runtime...
     *
     * @param Action $action
     * @param array $messages
     *
     * @return bool hook return value
     * @throws Exception
     */
    public function onEndScriptMessages(Action $action, array &$messages)
    {
        // TRANS: Text label for realtime view "play" button, usually replaced by an icon.
        $messages['realtime_play'] = _m('BUTTON', 'Play');
        // TRANS: Tooltip for realtime view "play" button.
        $messages['realtime_play_tooltip'] = _m('TOOLTIP', 'Play');
        // TRANS: Text label for realtime view "pause" button
        $messages['realtime_pause'] = _m('BUTTON', 'Pause');
        // TRANS: Tooltip for realtime view "pause" button
        $messages['realtime_pause_tooltip'] = _m('TOOLTIP', 'Pause');
        // TRANS: Text label for realtime view "popup" button, usually replaced by an icon.
        $messages['realtime_popup'] = _m('BUTTON', 'Pop up');
        // TRANS: Tooltip for realtime view "popup" button.
        $messages['realtime_popup_tooltip'] = _m('TOOLTIP', 'Pop up in a window');

        return true;
    }

    public function _updateInitialize($timeline, int $user_id)
    {
        return "RealtimeUpdate.init($user_id, \"$this->showurl\"); ";
    }

    public function _connect()
    {
    }

    public function _publish($timeline, $json)
    {
    }

    public function _disconnect()
    {
    }

    public function _pathToChannel(array $path): string
    {
        return '';
    }

    public function _getTimeline(Action $action)
    {
        $channel = $this->_getChannel($action);
        if (empty($channel)) {
            return null;
        }

        return $this->_pathToChannel([$channel->channel_key]);
    }

    public function _getChannel(Action $action)
    {
        $timeline = null;
        $arg1     = null;
        $arg2     = null;

        $action_name = $action->trimmed('action');

        // FIXME: lists
        // FIXME: search (!)
        // FIXME: profile + tag

        switch ($action_name) {
         case 'public':
            // no arguments
            break;
         case 'tag':
            $tag = $action->trimmed('tag');
            if (!empty($tag)) {
                $arg1 = $tag;
            } else {
                $this->log(LOG_NOTICE, "Unexpected 'tag' action without tag argument");
                return null;
            }
            break;
         case 'showstream':
         case 'all':
         case 'replies':
         case 'showgroup':
            $nickname = common_canonical_nickname($action->trimmed('nickname'));
            if (!empty($nickname)) {
                $arg1 = $nickname;
            } else {
                $this->log(LOG_NOTICE, "Unexpected $action_name action without nickname argument.");
                return null;
            }
            break;
         default:
            return null;
        }

        $user = common_current_user();

        $user_id = (!empty($user)) ? $user->id : null;

        $channel = Realtime_channel::getChannel(
            $user_id,
            $action_name,
            $arg1,
            $arg2
        );

        return $channel;
    }

    public function onStartReadWriteTables(&$alwaysRW, &$rwdb)
    {
        $alwaysRW[] = 'realtime_channel';
        return true;
    }
}


code:
<?php
// This file is part of GNU social - https://www.gnu.org/software/social
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GNU social is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Action to close a channel
 *
 * @category  Realtime
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */

defined('GNUSOCIAL') || die();

/**
 * Action to close a channel
 *
 * @category  Realtime
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */
class ClosechannelAction extends Action
{
    protected $channelKey = null;
    protected $channel = null;

    /**
     * For initializing members of the class.
     *
     * @param array $args misc. arguments
     *
     * @return boolean true
     * @throws ClientException
     */
    public function prepare(array $args = [])
    {
        parent::prepare($args);

        if (!$this->isPost()) {
            // TRANS: Client exception. Do not translate POST.
            throw new ClientException(_m('You have to POST it.'));
        }

        $this->channelKey = $this->trimmed('channelkey');

        if (empty($this->channelKey)) {
            // TRANS: Client exception thrown when the channel key argument is missing.
            throw new ClientException(_m('No channel key argument.'));
        }

        $this->channel = Realtime_channel::getKV('channel_key', $this->channelKey);

        if (empty($this->channel)) {
            // TRANS: Client exception thrown when referring to a non-existing channel.
            throw new ClientException(_m('No such channel.'));
        }

        return true;
    }

    /**
     * Handler method
     *
     * @return void
     */
    public function handle(): void
    {
        $this->channel->decrement();

        http_response_code(204);

        return;
    }

    /**
     * Return true if read only.
     *
     * MAY override
     *
     * @param array $args other arguments
     *
     * @return bool is read only action?
     */
    public function isReadOnly($args): bool
    {
        return false;
    }
}


code:
<?php
// This file is part of GNU social - https://www.gnu.org/software/social
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GNU social is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Action periodically pinged by a page to keep a channel alive
 *
 * @category  Realtime
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2011 StatusNet, Inc.
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */

defined('GNUSOCIAL') || die();

/**
 * Action periodically pinged by a page to keep a channel alive
 *
 * @category  Realtime
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2011 StatusNet, Inc.
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */
class KeepalivechannelAction extends Action
{
    protected $channelKey = null;
    protected $channel = null;

    /**
     * For initializing members of the class.
     *
     * @param array $args misc. arguments
     *
     * @return bool true
     * @throws ClientException
     */
    public function prepare(array $args = []): bool
    {
        parent::prepare($args);

        if (!$this->isPost()) {
            // TRANS: Client exception. Do not translate POST.
            throw new ClientException(_m('You have to POST it.'));
        }

        $this->channelKey = $this->trimmed('channelkey');

        if (empty($this->channelKey)) {
            // TRANS: Client exception thrown when the channel key argument is missing.
            throw new ClientException(_m('No channel key argument.'));
        }

        $this->channel = Realtime_channel::getKV('channel_key', $this->channelKey);

        if (empty($this->channel)) {
            // TRANS: Client exception thrown when referring to a non-existing channel.
            throw new ClientException(_m('No such channel.'));
        }

        return true;
    }

    /**
     * Handler method
     *
     * @return void
     */
    public function handle(): void
    {
        $this->channel->touch();

        http_response_code(204);

        return;
    }

    /**
     * Return true if read only.
     *
     * MAY override
     *
     * @param array $args other arguments
     *
     * @return bool is read only action?
     */
    public function isReadOnly($args): bool
    {
        return false;
    }
}


code:
<?php
// This file is part of GNU social - https://www.gnu.org/software/social
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// GNU social is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.

/**
 * A channel for real-time browser data
 *
 * For each user currently browsing the site, we want to know which page they're on
 * so we can send real-time updates to their browser.
 *
 * @category  Realtime
 * @package   GNUsocial
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 */

defined('GNUSOCIAL') || die();

/**
 * A channel for real-time browser data
 *
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 *
 * @see       DB_DataObject
 */
class Realtime_channel extends Managed_DataObject
{
    const TIMEOUT = 1800; // 30 minutes

    public $__table = 'realtime_channel'; // table name

    public $user_id;       // int -> user.id, can be null
    public $action;        // varchar(191)                  not 255 because utf8mb4 takes more space
    public $arg1;          // varchar(191)   argument       not 255 because utf8mb4 takes more space
    public $arg2;          // varchar(191)   usually null   not 255 because utf8mb4 takes more space
    public $channel_key;   // 128-bit shared secret key
    public $audience;      // listener count
    public $created;       // created date
    public $modified;      // modified date

    /**
     * The One True Thingy that must be defined and declared.
     */
    public static function schemaDef()
    {
        return [
            'description' => 'A channel of realtime notice data',
            'fields' => [
                'user_id' => ['type' => 'int',
                    'not null' => false,
                    'description' => 'user viewing page; can be null'],
                'action' => ['type' => 'varchar',
                    'length' => 191,
                    'not null' => true,
                    'description' => 'page being viewed'],
                'arg1' => ['type' => 'varchar',
                    'length' => 191,
                    'not null' => false,
                    'description' => 'page argument, like username or tag'],
                'arg2' => ['type' => 'varchar',
                    'length' => 191,
                    'not null' => false,
                    'description' => 'second page argument, like tag for showstream'],
                'channel_key' => ['type' => 'varchar',
                    'length' => 32,
                    'not null' => true,
                    'description' => 'shared secret key for this channel'],
                'audience' => ['type' => 'int',
                    'not null' => true,
                    'default' => 0,
                    'description' => 'reference count'],
                'created' => ['type' => 'datetime',
                    'not null' => true,
                    'description' => 'date this record was created'],
                'modified' => ['type' => 'datetime',
                    'not null' => true,
                    'description' => 'date this record was modified'],
            ],
            'primary key' => ['channel_key'],
            'unique keys' => [
                'realtime_channel_user_id_action_arg1_arg2_key' => ['user_id', 'action', 'arg1', 'arg2'],
            ],
            'foreign keys' => [
                'realtime_channel_user_id_fkey' => ['user', ['user_id' => 'id']],
            ],
            'indexes' => [
                'realtime_channel_modified_idx' => ['modified'],
                'realtime_channel_page_idx' => ['action', 'arg1', 'arg2']
            ],
        ];
    }

    public static function saveNew(int $user_id, Action $action, $arg1, $arg2): Realtime_channel
    {
        $channel = new Realtime_channel();

        $channel->user_id = $user_id;
        $channel->action = $action;
        $channel->arg1 = $arg1;
        $channel->arg2 = $arg2;
        $channel->audience = 1;

        $channel->channel_key = common_random_hexstr(16); // 128-bit key, 32 hex chars

        $channel->created = common_sql_now();
        $channel->modified = $channel->created;

        $channel->insert();

        return $channel;
    }

    public static function getChannel(int $user_id, Action $action, $arg1, $arg2): Realtime_channel
    {
        $channel = self::fetchChannel($user_id, $action, $arg1, $arg2);

        // Ignore (and delete!) old channels

        if (!empty($channel)) {
            $modTime = strtotime($channel->modified);
            if ((time() - $modTime) > self::TIMEOUT) {
                $channel->delete();
                $channel = null;
            }
        }

        if (empty($channel)) {
            $channel = self::saveNew($user_id, $action, $arg1, $arg2);
        }

        return $channel;
    }

    public static function getAllChannels(Action $action, $arg1, $arg2): array
    {
        $channel = new Realtime_channel();

        $channel->action = $action;

        if (is_null($arg1)) {
            $channel->whereAdd('arg1 is null');
        } else {
            $channel->arg1 = $arg1;
        }

        if (is_null($arg2)) {
            $channel->whereAdd('arg2 is null');
        } else {
            $channel->arg2 = $arg2;
        }

        $channel->whereAdd(sprintf("modified > TIMESTAMP '%s'", common_sql_date(time() - self::TIMEOUT)));

        $channels = [];

        if ($channel->find()) {
            $channels = $channel->fetchAll();
        }

        return $channels;
    }

    public static function fetchChannel(int $user_id, Action $action, $arg1, $arg2): ?Realtime_channel
    {
        $channel = new Realtime_channel();

        if (is_null($user_id)) {
            $channel->whereAdd('user_id is null');
        } else {
            $channel->user_id = $user_id;
        }

        $channel->action = $action;

        if (is_null($arg1)) {
            $channel->whereAdd('arg1 is null');
        } else {
            $channel->arg1 = $arg1;
        }

        if (is_null($arg2)) {
            $channel->whereAdd('arg2 is null');
        } else {
            $channel->arg2 = $arg2;
        }

        if ($channel->find(true)) {
            $channel->increment();
            return $channel;
        } else {
            return null;
        }
    }

    public function increment(): void
    {
        // XXX: race
        $orig = clone($this);
        $this->audience++;
        $this->modified = common_sql_now();
        $this->update($orig);
    }

    public function touch(): void
    {
        // XXX: race
        $orig = clone($this);
        $this->modified = common_sql_now();
        $this->update($orig);
    }

    public function decrement(): void
    {
        // XXX: race
        if ($this->audience == 1) {
            $this->delete();
        } else {
            $orig = clone($this);
            $this->audience--;
            $this->modified = common_sql_now();
            $this->update($orig);
        }
    }
}


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-14 14:51+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. TRANS: Text label for realtime view "play" button, usually replaced by an icon.
#: RealtimePlugin.php:388
msgctxt "BUTTON"
msgid "Play"
msgstr ""

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:390
msgctxt "TOOLTIP"
msgid "Play"
msgstr ""

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:392
msgctxt "BUTTON"
msgid "Pause"
msgstr ""

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:394
msgctxt "TOOLTIP"
msgid "Pause"
msgstr ""

#. TRANS: Text label for realtime view "popup" button, usually replaced by an icon.
#: RealtimePlugin.php:396
msgctxt "BUTTON"
msgid "Pop up"
msgstr ""

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:398
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr ""

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:66 actions/closechannel.php:66
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:73 actions/closechannel.php:73
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:80 actions/closechannel.php:80
msgid "No such channel."
msgstr ""


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2010 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:42+0000\n"
"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
"Language-Team: Afrikaans (http://www.transifex.com/gnu-social/gnu-social/language/af/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: af\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr "Speel"

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr "Speel"

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr "Wag"

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr "Wag"

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr "Pop-up"

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr "Wys in 'n venstertjie"


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2011 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:42+0000\n"
"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
"Language-Team: Arabic (http://www.transifex.com/gnu-social/gnu-social/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr "شغّل"

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr "شغّل"

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr "ألبث"

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr "ألبث"

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr "منبثق"

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr "منبثق في نافذة"


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2015 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:38+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Arabic (Egypt) (http://www.transifex.com/gnu-social/gnu-social/language/ar_EG/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar_EG\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr ""

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr ""

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr ""

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr ""

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr ""

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr ""


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2015 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:38+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Asturian (http://www.transifex.com/gnu-social/gnu-social/language/ast/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ast\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr ""

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr ""

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr ""

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr ""

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr ""

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr ""


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2015 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:38+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Belarusian (Tarask) (http://www.transifex.com/gnu-social/gnu-social/language/be@tarask/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: be@tarask\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr ""

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr ""

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr ""

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr ""

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr ""

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr ""


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2015 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:38+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Bulgarian (http://www.transifex.com/gnu-social/gnu-social/language/bg/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr ""

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr ""

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr ""

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr ""

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr ""

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr ""


code:
# Translation file for GNU social - the free software social networking platform
# Copyright (C) 2015 - 2019 Free Software Foundation, Inc http://www.fsf.org
# This file is under https://www.gnu.org/licenses/agpl v3 or later
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 09:38+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Bengali (India) (http://www.transifex.com/gnu-social/gnu-social/language/bn_IN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: bn_IN\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Client exception. Do not translate POST.
#: actions/keepalivechannel.php:65 actions/closechannel.php:65
msgid "You have to POST it."
msgstr ""

#. TRANS: Client exception thrown when the channel key argument is missing.
#: actions/keepalivechannel.php:72 actions/closechannel.php:72
msgid "No channel key argument."
msgstr ""

#. TRANS: Client exception thrown when referring to a non-existing channel.
#: actions/keepalivechannel.php:79 actions/closechannel.php:79
msgid "No such channel."
msgstr ""

#. TRANS: Text label for realtime view "play" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:387
msgctxt "BUTTON"
msgid "Play"
msgstr ""

#. TRANS: Tooltip for realtime view "play" button.
#: RealtimePlugin.php:389
msgctxt "TOOLTIP"
msgid "Play"
msgstr ""

#. TRANS: Text label for realtime view "pause" button
#: RealtimePlugin.php:391
msgctxt "BUTTON"
msgid "Pause"
msgstr ""

#. TRANS: Tooltip for realtime view "pause" button
#: RealtimePlugin.php:393
msgctxt "TOOLTIP"
msgid "Pause"
msgstr ""

#. TRANS: Text label for realtime view "popup" button, usually replaced by an
#. icon.
#: RealtimePlugin.php:395
msgctxt "BUTTON"
msgid "Pop up"
msgstr ""

#. TRANS: Tooltip for realtime view "popup" button.
#: RealtimePlugin.php:397
msgctxt "TOOLTIP"
msgid "Pop up in a window"
msgstr ""