code:
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2008, 2009, StatusNet, Inc.
 *
 * 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/>.
 */

if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }

/**
 * IRC background connection manager for IRC-using queue handlers,
 * allowing them to send outgoing messages on the right connection.
 *
 * Input is handled during socket select loop, Any incoming messages will be handled.
 *
 * In a multi-site queuedaemon.php run, one connection will be instantiated
 * for each site being handled by the current process that has IRC enabled.
 */
class IrcManager extends ImManager {
    protected $conn = null;
    protected $lastPing = null;
    protected $messageWaiting = true;
    protected $lastMessage = null;

    protected $regChecks = array();
    protected $regChecksLookup = array();

    protected $connected = false;

    /**
     * Initialize connection to server.
     *
     * @return boolean true on success
     */
    public function start($master) {
        if (parent::start($master)) {
            $this->connect();
            return true;
        } else {
            return false;
        }
    }

    /**
    * Return any open sockets that the run loop should listen
    * for input on.
    *
    * @return array Array of socket resources
    */
    public function getSockets() {
        $this->connect();
        if ($this->conn) {
            return $this->conn->getSockets();
        } else {
            return array();
        }
    }

    /**
     * Request a maximum timeout for listeners before the next idle period.
     *
     * @return integer Maximum timeout
     */
    public function timeout() {
        if ($this->messageWaiting) {
            return 1;
        } else {
            return $this->plugin->pinginterval;
        }
    }

    /**
     * Idle processing for io manager's execution loop.
     *
     * @return void
     */
    public function idle() {
        // Send a ping if necessary
        if (empty($this->lastPing) || time() - $this->lastPing > $this->plugin->pinginterval) {
            $this->sendPing();
        }

        if ($this->connected) {
            // Send a waiting message if appropriate
            if ($this->messageWaiting && time() - $this->lastMessage > 1) {
                $wm = Irc_waiting_message::top();
                if ($wm === NULL) {
                    $this->messageWaiting = false;
                    return;
                }

                $data = unserialize($wm->data);
                $wm->incAttempts();

                if ($this->send_raw_message($data)) {
                    $wm->delete();
                } else {
                    if ($wm->attempts <= common_config('queue', 'max_retries')) {
                        // Try again next idle
                        $wm->releaseClaim();
                    } else {
                        // Exceeded the maximum number of retries
                        $wm->delete();
                    }
                }
            }
        }
    }

    /**
     * Process IRC events that have come in over the wire.
     *
     * @param resource $socket Socket to handle input on
     * @return void
     */
    public function handleInput($socket) {
        common_log(LOG_DEBUG, 'Servicing the IRC queue.');
        $this->stats('irc_process');

        try {
            $this->conn->handleEvents();
        } catch (Phergie_Driver_Exception $e) {
            $this->connected = false;
            $this->conn->reconnect();
        }
    }

    /**
    * Initiate connection
    *
    * @return void
    */
    public function connect() {
        if (!$this->conn) {
            $this->conn = new Phergie_StatusnetBot;

            $config = new Phergie_Config;
            $config->readArray(
                array(
                    'connections' => array(
                        array(
                            'host' => $this->plugin->host,
                            'port' => $this->plugin->port,
                            'username' => $this->plugin->username,
                            'realname' => $this->plugin->realname,
                            'nick' => $this->plugin->nick,
                            'password' => $this->plugin->password,
                            'transport' => $this->plugin->transporttype,
                            'encoding' => $this->plugin->encoding
                        )
                    ),

                    'driver' => 'statusnet',

                    'processor' => 'async',
                    'processor.options' => array('sec' => 0, 'usec' => 0),

                    'plugins' => array(
                        'Pong',
                        'NickServ',
                        'AutoJoin',
                        'Statusnet',
                    ),

                    'plugins.autoload' => true,

                    // Uncomment to enable debugging output
                    //'ui.enabled' => true,

                    'nickserv.password' => $this->plugin->nickservpassword,
                    'nickserv.identify_message' => $this->plugin->nickservidentifyregexp,

                    'autojoin.channels' => $this->plugin->channels,

                    'statusnet.messagecallback' => array($this, 'handle_irc_message'),
                    'statusnet.regcallback' => array($this, 'handle_reg_response'),
                    'statusnet.connectedcallback' => array($this, 'handle_connected'),
                    'statusnet.unregregexp' => $this->plugin->unregregexp,
                    'statusnet.regregexp' => $this->plugin->regregexp
                )
            );

            $this->conn->setConfig($config);
            $this->conn->connect();
            $this->lastPing = time();
            $this->lastMessage = time();
        }
        return $this->conn;
    }

    /**
    * Called via a callback when a message is received
    * Passes it back to the queuing system
    *
    * @param array $data Data
    * @return boolean
    */
    public function handle_irc_message($data) {
        $this->plugin->enqueueIncomingRaw($data);
        return true;
    }

    /**
    * Called via a callback when NickServ responds to
    * the bots query asking if a nick is registered
    *
    * @param array $data Data
    * @return void
    */
    public function handle_reg_response($data) {
        // Retrieve data
        $screenname = $data['screenname'];
        $nickdata = $this->regChecks[$screenname];
        $usernick = $nickdata['user']->nickname;

        if (isset($this->regChecksLookup[$usernick])) {
            if ($data['registered']) {
                // Send message
                $this->plugin->sendConfirmationCode($screenname, $nickdata['code'], $nickdata['user'], true);
            } else {
                // TRANS: Message given when using an unregistered IRC nickname.
                $this->plugin->sendMessage($screenname, _m('Your nickname is not registered so IRC connectivity cannot be enabled.'));

                $confirm = new Confirm_address();

                $confirm->user_id      = $user->id;
                $confirm->address_type = $this->plugin->transport;

                if ($confirm->find(true)) {
                    $result = $confirm->delete();

                    if (!$result) {
                        common_log_db_error($confirm, 'DELETE', __FILE__);
                        // TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
                        throw new ServerException(_m('Could not delete confirmation.'));
                    }
                }
            }

            // Unset lookup value
            unset($this->regChecksLookup[$usernick]);

            // Unset data
            unset($this->regChecks[$screename]);
        }
    }

    /**
    * Called when the connection is established
    *
    * @return void
    */
    public function handle_connected() {
        $this->connected = true;
    }

    /**
    * Enters a message into the database for sending when ready
    *
    * @param string $command Command
    * @param array $args Arguments
    * @return boolean
    */
    protected function enqueue_waiting_message($data) {
        $wm = new Irc_waiting_message();

        $wm->data       = serialize($data);
        $wm->prioritise = $data['prioritise'];
        $wm->attempts   = 0;
        $wm->created    = common_sql_now();
        $result         = $wm->insert();

        if (!$result) {
            common_log_db_error($wm, 'INSERT', __FILE__);
            // TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
            throw new ServerException(_m('Database error inserting IRC waiting queue item.'));
        }

        return true;
    }

    /**
     * Send a message using the daemon
     *
     * @param $data Message data
     * @return boolean true on success
     */
    public function send_raw_message($data) {
        $this->connect();
        if (!$this->conn) {
            return false;
        }

        if ($data['type'] != 'delayedmessage') {
            if ($data['type'] != 'message') {
                // Nick checking
                $nickdata = $data['nickdata'];
                $usernick = $nickdata['user']->nickname;
                $screenname = $nickdata['screenname'];

                // Cancel any existing checks for this user
                if (isset($this->regChecksLookup[$usernick])) {
                    unset($this->regChecks[$this->regChecksLookup[$usernick]]);
                }

                $this->regChecks[$screenname] = $nickdata;
                $this->regChecksLookup[$usernick] = $screenname;
            }

            // If there is a backlog or we need to wait, queue the message
            if ($this->messageWaiting || time() - $this->lastMessage < 1) {
                $this->enqueue_waiting_message(
                    array(
                        'type' => 'delayedmessage',
                        'prioritise' => $data['prioritise'],
                        'data' => $data['data']
                    )
                );
                $this->messageWaiting = true;
                return true;
            }
        }

        try {
            $this->conn->send($data['data']['command'], $data['data']['args']);
        } catch (Phergie_Driver_Exception $e) {
            $this->connected = false;
            $this->conn->reconnect();
            return false;
        }

        $this->lastMessage = time();
        return true;
    }

    /**
    * Sends a ping
    *
    * @return void
    */
    protected function sendPing() {
        $this->lastPing = time();
        $this->conn->send('PING', $this->lastPing);
    }
}


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: 2012-06-30 11:07+0000\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. TRANS: Service name for IRC.
#: IrcPlugin.php:79
msgid "IRC"
msgstr ""

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#: IrcPlugin.php:296
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
#: IrcPlugin.php:346
msgid "You must specify a host."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
#: IrcPlugin.php:350
msgid "You must specify a username."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
#: IrcPlugin.php:354
msgid "You must specify a \"real name\"."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
#: IrcPlugin.php:358
msgid "You must specify a nickname."
msgstr ""

#. TRANS: Plugin description.
#: IrcPlugin.php:401
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#: Irc_waiting_message.php:130
#, php-format
msgid "Could not increment attempts count for %d."
msgstr ""

#. TRANS: Message given when using an unregistered IRC nickname.
#: ircmanager.php:234
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
#: ircmanager.php:247
msgid "Could not delete confirmation."
msgstr ""

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
#: ircmanager.php:289
msgid "Database error inserting IRC waiting queue item."
msgstr ""

license: mit


code:
# Translation of StatusNet - Irc to Catalan (català)
# Exported from translatewiki.net
#
# Author: Toniher
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:54+0000\n"
"Language-Team: Catalan <https://translatewiki.net/wiki/Portal:ca>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ca\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"L'usuari «%1$s» a %2$s diu que el vostre nom %3$s li pertany. Si això fos "
"veritat, podeu confirmar-ho clicant a l'URL: %4$s . (Si no podeu clicar-hi, "
"copieu-la i enganxeu-la a la barra d'ubicació del vostre navegador). Si no "
"fóssiu aquest usuari, o bé si no heu sol·licitat aquesta confirmació, "
"simplement ignoreu el missatge."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Heu d'especificar un servidor central."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Heu d'especificar un nom d'usuari."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Heu d'especificar un «nom real»."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Heu d'especificar un sobrenom."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"El connector IRC permet als usuaris enviar i rebre avisos des d'una xarxa "
"IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr ""

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "No s'ha pogut eliminar la confirmació."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""


code:
# Translation of StatusNet - Irc to German (Deutsch)
# Exported from translatewiki.net
#
# Author: Giftpflanze
# Author: MF-Warburg
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:54+0000\n"
"Language-Team: German <https://translatewiki.net/wiki/Portal:de>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: de\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"Benutzer „%1$s“ auf %2$s sagt, dass dein Benutzername auf %3$s ihm gehört. "
"Wenn das richtig ist, kannst du dies bestätigen, indem du auf diesen Link "
"klickst: %4$s . (Wenn du ihn nicht anklicken kannst, kopieren ihn in die "
"Adressleiste deines Browsers). Wenn du nicht dieser Benutzer bist, oder du "
"diese Bestätigung nicht angefragt hast, ignoriere diese Nachricht einfach."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Du musst einen Host angeben."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Du musst einen Benutzernamen angeben."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Du musst einen \"echten Namen\" angeben."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Du musst einen Nick angeben."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Das IRC-Plugin erlaubt es Benutzern Nachrichten über ein IRC-Netwerk zu "
"senden und zu empfangen."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Konnte Versuchszähler für %d nicht erhöhen."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Dein Nick ist nicht registriert, sodass die IRC-Verbindung nicht hergestellt "
"werden kann."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Konnte Bestätigung nicht löschen."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr "Beim Einfügen des IRC-Queueitems ist ein Datenbankfehler aufgetreten."


code:
# Translation of StatusNet - Irc to Spanish (español)
# Exported from translatewiki.net
#
# Author: Armando-Martin
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:54+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"El usuario \"%1$s\" de  %2$s  ha dicho que su pseudónimo  %3$s le pertenece. "
"Si eso es cierto, puede confirmarlo haciendo clic en esta dirección URL:  %4"
"$s  . (Si no puede hacer clic en esa dirección, cópiela y péguela en la "
"barra de direcciones del navegador). Si el usuario no es usted, o si no "
"pidió esta confirmación, simplemente ignore este mensaje."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Debe especificar un servidor (host)."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Debe especificar un nombre de usuario."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Debe especificar un \"nombre real\"."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Debe especificar un alias."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"El complemento (plugin) IRC permite a los usuarios enviar y recibir mensajes "
"mediante una red IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "No se pudo incrementar el número de intentos de %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Su pseudónimo (nickname) no está registrado, por lo que no se puede "
"habilitar la conectividad IRC."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "No se pudo eliminar la confirmación."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""
"Error de base de datos al insertar un elemento en la cola de espera de IRC."


code:
# Translation of StatusNet - Irc to Basque (euskara)
# Exported from translatewiki.net
#
# Author: Artsuaga
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:54+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"%2$s guneko %1$s erabiltzaileak %3$s izena berea dela dio. Egia bada, URL "
"honetan klik eginda baiezta dezakezu: %4$s . (Ezin baduzu klik egin, kopiatu "
"eta zure nabigatzailearen helbide barran itsatsi).  Erailtzaile hori zu ez "
"bazara, edo ez baduzu baieztapen-eskaririk egin, ez egin jaramonik mezu honi."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Host bat zehaztu behar duzu."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Erabiltzaile izen bat zehaztu behar duzu."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Benetako izen bat zehaztu behar duzu."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Ezizen bat zehaztu behar duzu."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"IRC pluginak erabiltzaileei IRC sare bidez oharrak bidali eta jasotzen uzten "
"die."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Ezin izan da gehitu %d(r)entzako saiakera kopurua."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr "Zure ezizena erregistraturik ez dagoenez IRC koneksioa ezin da gaitu."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Ezin izan da baieztapena ezabatu."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr "Datubase akatsa IRC itxarote zerrendan elementu bat gehitzean."


code:
# Translation of StatusNet - Irc to Finnish (Suomi)
# Exported from translatewiki.net
#
# Author: Nike
# Author: XTL
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-04-27 12:36+0000\n"
"PO-Revision-Date: 2011-04-27 12:37:25+0000\n"
"Language-Team: Finnish <http://translatewiki.net/wiki/Portal:fi>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-04-17 22:40:37+0000\n"
"X-Generator: MediaWiki 1.18alpha (r87008); Translate extension (2011-04-26)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: fi\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr ""

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"IRC-liitännäinen mahdollistaa viestien lähettämisen ja vastaanottamisen IRC-"
"verkkoa käyttäen."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr ""

#. TRANS: Message given when using an unregistered IRC nickname.
#, fuzzy
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"IRC-nimimerkkiäsi ei ole rekisteröity, joten IRC-yhteyttä ei voida ottaa "
"käyttöön"

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr ""

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""


code:
# Translation of StatusNet - Irc to French (français)
# Exported from translatewiki.net
#
# Author: Coyau
# Author: Gomoko
# Author: Hashar
# Author: IAlex
# Author: Od1n
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:54+0000\n"
"Language-Team: French <https://translatewiki.net/wiki/Portal:fr>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: fr\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"L’utilisateur \"%1$s\" sur %2$s a déclaré que votre nom affiché %3$s lui "
"appartient. Si c'est le cas, vous pouvez le confirmer en cliquant sur cette "
"URL: %4$s. (Si vous ne pouvez pas cliquer dessus, copiez-collez l’URL dans "
"la barre d’adresse de votre navigateur). Si cet utilisateur n’est pas vous, "
"ou si vous n’avez pas vous-même demandé cette confirmation, veuillez "
"simplement ignorer ce message."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Vous devez indiquer un hôte."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Vous devez indiquer un nom d'utilisateur"

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Vous devez indiquer un « vrai nom »."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Vous devez indiquer un pseudonyme."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Le plugin IRC permet aux utilisateurs d'envoyer et de recevoir des messages "
"depuis un réseau IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Impossible d'augmenter le décompte de l'objet %d"

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Votre pseudo n'est pas enregistré, la connexion IRC ne peut donc pas être "
"activée"

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Échec de la suppression de la confirmation."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""
"Erreur de base de données lors de l'insertion d'un élément de file d'attente "
"IRC."


code:
# Translation of StatusNet - Irc to Galician (galego)
# Exported from translatewiki.net
#
# Author: Toliño
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Language-Team: Galician <https://translatewiki.net/wiki/Portal:gl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: gl\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"O usuario \"%1$s\" de %2$s dixo que o pseudónimo %3$s perténcelle a el ou "
"ela. Se é certo, pódeo confirmar premendo neste enderezo URL: %4$s. (Se non "
"pode premer nel, copie e pegue o enderezo na barra de enderezos do "
"navegador.) Se ese usuario non é vostede ou se non solicitou esta "
"confirmación, ignore esta mensaxe."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Cómpre especificar un provedor de hospedaxe."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Cómpre especificar un nome de usuario."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Cómpre especificar un nome real."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Cómpre especificar un alcume."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"O complemento IRC permite aos usuarios enviar e recibir mensaxes desde a "
"rede de IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Non se puido incrementar o número de intentos de %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"O seu alcume non está rexistrado, de modo que non se pode activar a "
"conectividade IRC."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Non se puido borrar a confirmación."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr "Erro na base de datos ao inserir un elemento na cola de espera de IRC."


code:
# Translation of StatusNet - Irc to Interlingua (interlingua)
# Exported from translatewiki.net
#
# Author: McDutchie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Language-Team: Interlingua <https://translatewiki.net/wiki/Portal:ia>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ia\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"Le usator \"%1$s\" de %2$s ha dicite que tu pseudonymo de %3$s pertine a "
"ille o illa. Si isto es correcte, tu pote confirmar lo con un clic super "
"iste URL: %4$s . (Si tu non pote cliccar super illo, copia-e-colla lo in le "
"barra de adresse de tu navigator del web.) Si tu non es iste usator, o si tu "
"non requestava iste confirmation, simplemente ignora iste message."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Es necessari specificar un host."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Es necessari specificar un nomine de usator."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Es necessari specificar un \"nomine real\"."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Es necessari specificar un pseudonymo."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Le plug-in de IRC permitte que usatores invia e recipe notas per un rete de "
"IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Non poteva incrementar le numero de tentativas pro %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Tu pseudonymo non es registrate, dunque le connexion a IRC non pote esser "
"activate."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Non poteva deler le confirmation."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""
"Error del base de datos durante le insertion de un elemento in le cauda de "
"attender de IRC."


code:
# Translation of StatusNet - Irc to Italian (italiano)
# Exported from translatewiki.net
#
# Author: GreenFox
# Author: Ximo17
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"L'utente \"%1$s\" su %2$s ha detto che il tuo nome visualizzato %3$s gli "
"appartiene. Se è vero, puoi confermare cliccando su questa URL: %4$s . (Se "
"non riesci a cliccare, copia e incolla la URL nella barra degli indirizzi "
"del tuo browser). Se quest'utente non sei tu, o se non hai richiesto tu "
"questa conferma, ignora semplicemente questo messaggio."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "È necessario specificare un host."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "È necessario specificare un nome utente."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "È necessario specificare un \"nome reale\"."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "È necessario specificare un nickname."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Il plugin per IRC consente agli utenti di inviare e ricevere le notizie "
"tramite la rete IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Impossibile incrementare il conteggio dei tentativi per %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Il tuo nickname non è registrato di conseguenza la connettività IRC non "
"potrà essere attivata."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Impossibile eliminare la conferma."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""
"Errore nel database nell'inserimento dell'oggetto della coda d'attesa su IRC."


code:
# Translation of StatusNet - Irc to Japanese (日本語)
# Exported from translatewiki.net
#
# Author: Shirayuki
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "ホストを指定してください。"

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "ユーザー名を指定してください。"

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "「本名」を指定してください。"

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "ニックネームを指定してください。"

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr ""

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr ""

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""


code:
# Translation of StatusNet - Irc to Macedonian (македонски)
# Exported from translatewiki.net
#
# Author: Bjankuloski06
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Language-Team: Macedonian <https://translatewiki.net/wiki/Portal:mk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: mk\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"Корисникот „%1$s“ на %2$s има изјавено дека Вашиот прекар на %3$s е всушност "
"негов. Ако ова е вистина, можете да потврдите стискајќи на оваа URL-адреса: %"
"4$s . (Ако не можете да ја стиснете, прекопирајте ја во адресната лента на "
"прелистувачот). Ако ова не сте Вие, или ако не ја имате побарано оваа "
"потврда, слободно занемарете ја поракава."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Мора да наведете домаќин."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Мора да наведете корисничко име."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Мора да наведете „вистинско име“."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Мора да наведете прекар."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Приклучокот за IRC им овозможува на корисниците да испраќаат и примаат "
"забелешки преку мрежата на IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Не можев да го дополнам бројот на обиди за %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Вашиот прекар не е регистриран, па затоа не може да се овозможи поврзувањето "
"со IRC."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Не можев да ја избришам потврдата."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr "Грешка во базата при вметнувањето на редицата на чекање за IRC ."


code:
# Translation of StatusNet - Irc to Dutch (Nederlands)
# Exported from translatewiki.net
#
# Author: SPQRobin
# Author: Siebrand
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Language-Team: Dutch <https://translatewiki.net/wiki/Portal:nl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: nl\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"Gebruiker \"%1$s\" op de site %2$s heeft aangegeven dat de schermnaam %3$s "
"van hem is. Als dat klopt, dan kunt u dit bevestigen door op deze verwijzing "
"te klikken: %4$s. Als u hier niet op kunt klikken, kopieer en plak deze "
"verwijzing naar in de adresbalk van uw webbrowser. Als u deze gebruiker niet "
"bent, of u hebt niet om deze bevestiging gevraagd, negeer dit bericht dan."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "U moet een host opgeven."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "U moet een gebruikersnaam opgeven."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "U moet een echte naam opgeven."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "U moet een gebruikersnaam opgeven."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Maakt het mogelijk om mededelingen te zenden naar en ontvangen van een IRC-"
"netwerk."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Het was niet mogelijk om het aantal pogingen voor %d op te hogen"

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Uw gebruikersnaam is niet geregistreerd en daarom kan er geen koppeling met "
"IRC worden gemaakt."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "De bevestiging kon niet verwijderd worden."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""
"Er is een databasefout opgetreden tijdens het invoegen van het IRC-queueitem."


code:
# Translation of StatusNet - Irc to Swedish (svenska)
# Exported from translatewiki.net
#
# Author: Lokal Profil
# Author: WikiPhoenix
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Language-Team: Swedish <https://translatewiki.net/wiki/Portal:sv>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: sv\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Du måste ange en värd."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Du måste ange ett användarnamn."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Du måste ange ett \"riktigt namn\"."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Du måste ange ett smeknamn."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"IRC-tillägget tillåter användare skicka och ta emot meddelanden över IRC-"
"nätverket."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr ""

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Ditt smeknamn är inte registrerat, så IRC-anslutningar kan inte aktiveras."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr ""

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""


code:
# Translation of StatusNet - Irc to Tagalog (Tagalog)
# Exported from translatewiki.net
#
# Author: AnakngAraw
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:55+0000\n"
"Language-Team: Tagalog <https://translatewiki.net/wiki/Portal:tl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: tl\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"Sinabi ng tagagamit na si \"%1$s\" sa %2$s na ang bansag mong %3$s ay pag-"
"aari nila. Kung iyan ay totoo, matitiyak mo sa pamamagitan ng pagpindot sa "
"URL na ito: %4$s. (Kung hindi mo ito mapindot, kopyahin at idikit ito sa "
"loob ng halang ng tirahan ng iyong pantingin-tingin). Kung hindi ikaw ang "
"tagagamit na iyan, o hindi mo hiniling ang pagtitiyak na ito, huwag na "
"lamang pansinin ang mensaheng ito."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Dapat kang tumukoy ng isang tagapagpasinaya."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Dapat kang tumukoy ng isang pangalan ng tagagamit."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Dapat kang tumukoy ng isang \"tunay na pangalan\"."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Dapat kang tumukoy ng isang palayaw."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Ang pampasak na IRC ay nagpapahintulot sa mga tagagamit na makapagpadala at "
"makatanggap ng mga pabatid sa ibabaw ng kalambatan ng IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Hindi masudlungan ang bilang ng mga pagtatangka para sa %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr "Hindi nakatala ang palayaw mo kaya't hindi mapagana ang ugnay ng IRC."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Hindi mabura ang pagtitiyak."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""
"Kamalian ng kalipunan ng dato sa pagsisingit ng IRD na naghihintay ng bagay "
"ng pila."


code:
# Translation of StatusNet - Irc to Turkish (Türkçe)
# Exported from translatewiki.net
#
# Author: Emperyan
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:56+0000\n"
"Language-Team: Turkish <https://translatewiki.net/wiki/Portal:tr>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: tr\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Bir ana bilgisayar belirtmeniz gerekir."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Bir kullanıcı adı belirtmelisiniz."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "\"Gerçek adınızı\" belirtmelisiniz."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Bir takma ad belirtmelisiniz."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr ""

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Onay silinemedi."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr ""


code:
# Translation of StatusNet - Irc to Ukrainian (українська)
# Exported from translatewiki.net
#
# Author: Boogie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Irc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:08:56+0000\n"
"Language-Team: Ukrainian <https://translatewiki.net/wiki/Portal:uk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:50:23+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: uk\n"
"X-Message-Group: #out-statusnet-plugin-irc\n"
"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= "
"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n"

#. TRANS: Service name for IRC.
msgid "IRC"
msgstr "IRC"

#. TRANS: Body text for e-mail confirmation message for IRC.
#. TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
#. TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
#, php-format
msgid ""
"User \"%1$s\" on %2$s has said that your %3$s screenname belongs to them. If "
"that's true, you can confirm by clicking on this URL: %4$s . (If you cannot "
"click it, copy-and-paste it into the address bar of your browser). If that "
"user is not you, or if you did not request this confirmation, just ignore "
"this message."
msgstr ""
"Користувач «%1$s» на сайті %2$s повідомив, що ваш псевдонім %3$s належить "
"йому. Якщо це дійсно так, ви можете підтвердити це просто перейшовши за "
"наступною ланкою: %4$s. (Якщо ви не можете натиснути на посилання, то "
"скопіюйте адресу до адресного рядка вашого веб-оглядача.) Якщо ви не є "
"згаданим користувачем, не підтверджуйте нічого, просто проігноруйте це "
"повідомлення."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a host."
msgstr "Ви повинні вказати хост.."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a username."
msgstr "Ви повинні зазначити ім’я користувача."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a \"real name\"."
msgstr "Ви повинні зазначити «справжнє ім’я»."

#. TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
msgid "You must specify a nickname."
msgstr "Ви повинні зазначити псевдонім."

#. TRANS: Plugin description.
msgid ""
"The IRC plugin allows users to send and receive notices over an IRC network."
msgstr ""
"Додаток IRC дозволяє користувачам надсилати і отримувати дописи у мережі IRC."

#. TRANS: Exception thrown when an IRC attempts count could not be updated.
#. TRANS: %d is the object ID for which the count could not be updated.
#, php-format
msgid "Could not increment attempts count for %d."
msgstr "Не вдалося збільшити кількість спроб для %d."

#. TRANS: Message given when using an unregistered IRC nickname.
msgid "Your nickname is not registered so IRC connectivity cannot be enabled."
msgstr ""
"Ваш псевдонім не зареєстровано і тому підключення до IRC увімкнути неможливо."

#. TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
msgid "Could not delete confirmation."
msgstr "Не вдалося видалити підтвердження."

#. TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
msgid "Database error inserting IRC waiting queue item."
msgstr "Помилка бази даних при вставці елемента черги очікування IRC."


code:
StartDiscoveryMethodRegistration
- $disco:   Discovery object that accepts the registrations

EndDiscoveryMethodRegistration: Register remote URI discovery methods
- $disco:   Discovery object that accepts the registrations


code:
<?php
/*
 * GNU Social - a federating social network
 * Copyright (C) 2013, Free Software Foundation, Inc.
 *
 * 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/>.
 */

/**
 * Implements Link-based Resource Descriptor Discovery based on RFC6415,
 * Web Host Metadata, i.e. the predecessor to WebFinger resource discovery.
 *
 * @package GNUsocial
 * @author  Mikael Nordfeldth <mmn@hethane.se>
 */

if (!defined('GNUSOCIAL')) { exit(1); }

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/extlib/');

class LRDDPlugin extends Plugin
{
    public function onAutoload($cls)
    {
        switch ($cls) {
        case 'XML_XRD':
            require_once __DIR__ . '/extlib/XML/XRD.php';
            return false;
        }

        return parent::onAutoload($cls);
    }
    public function onStartDiscoveryMethodRegistration(Discovery $disco) {
        $disco->registerMethod('LRDDMethod_WebFinger');
    }

    public function onEndDiscoveryMethodRegistration(Discovery $disco) {
        $disco->registerMethod('LRDDMethod_HostMeta');
        $disco->registerMethod('LRDDMethod_LinkHeader');
        $disco->registerMethod('LRDDMethod_LinkHTML');
    }

    public function onPluginVersion(&$versions)
    {
        $versions[] = array('name' => 'LRDD',
                            'version' => GNUSOCIAL_VERSION,
                            'author' => 'Mikael Nordfeldth',
                            'homepage' => 'http://www.gnu.org/software/social/',
                            // TRANS: Plugin description.
                            'rawdescription' => _m('Implements LRDD support for GNU Social.'));

        return true;
    }
}


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

require_once 'XML/XRD/PropertyAccess.php';
require_once 'XML/XRD/Element/Link.php';
require_once 'XML/XRD/Loader.php';
require_once 'XML/XRD/Serializer.php';

/**
 * Main class used to load XRD documents from string or file.
 *
 * After loading the file, access to links is possible with get() and getAll(),
 * as well as foreach-iterating over the XML_XRD object.
 *
 * Property access is possible with getProperties() and array access (foreach)
 * on the XML_XRD object.
 *
 * Verification that the subject/aliases match the requested URL can be done with
 * describes().
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
class XML_XRD extends XML_XRD_PropertyAccess implements IteratorAggregate
{
    /**
     * XRD file/string loading dispatcher
     *
     * @var XML_XRD_Loader
     */
    public $loader;

    /**
     * XRD serializing dispatcher
     *
     * @var XML_XRD_Serializer
     */
    public $serializer;

    /**
     * XRD subject
     *
     * @var string
     */
    public $subject;

    /**
     * Array of subject alias strings
     *
     * @var array
     */
    public $aliases = array();

    /**
     * Array of link objects
     *
     * @var array
     */
    public $links = array();

    /**
     * Unix timestamp when the document expires.
     * NULL when no expiry date set.
     *
     * @var integer|null
     */
    public $expires;

    /**
     * xml:id of the XRD document
     *
     * @var string|null
     */
    public $id;

    /**
     * Loads the contents of the given file.
     *
     * Note: Only use file type auto-detection for local files.
     * Do not use it on remote files as the file gets requested several times.
     *
     * @param string $file Path to an XRD file
     * @param string $type File type: xml or json, NULL for auto-detection
     *
     * @return void
     *
     * @throws XML_XRD_Loader_Exception When the file is invalid or cannot be
     *                                   loaded
     */
    public function loadFile($file, $type = null)
    {
        if (!isset($this->loader)) {
            $this->loader = new XML_XRD_Loader($this);
        }
        return $this->loader->loadFile($file, $type);
    }

    /**
     * Loads the contents of the given string
     *
     * @param string $str  XRD string
     * @param string $type File type: xml or json, NULL for auto-detection
     *
     * @return void
     *
     * @throws XML_XRD_Loader_Exception When the string is invalid or cannot be
     *                                   loaded
     */
    public function loadString($str, $type = null)
    {
        if (!isset($this->loader)) {
            $this->loader = new XML_XRD_Loader($this);
        }
        return $this->loader->loadString($str, $type);
    }

    /**
     * Checks if the XRD document describes the given URI.
     *
     * This should always be used to make sure the XRD file
     * is the correct one for e.g. the given host, and not a copycat.
     *
     * Checks against the subject and aliases
     *
     * @param string $uri An URI that the document is expected to describe
     *
     * @return boolean True or false
     */
    public function describes($uri)
    {
        if ($this->subject == $uri) {
            return true;
        }
        foreach ($this->aliases as $alias) {
            if ($alias == $uri) {
                return true;
            }
        }

        return false;
    }

    /**
     * Get the link with highest priority for the given relation and type.
     *
     * @param string  $rel          Relation name
     * @param string  $type         MIME Type
     * @param boolean $typeFallback When true and no link with the given type
     *                              could be found, the best link without a
     *                              type will be returned
     *
     * @return XML_XRD_Element_Link Link object or NULL if none found
     */
    public function get($rel, $type = null, $typeFallback = true)
    {
        $links = $this->getAll($rel, $type, $typeFallback);
        if (count($links) == 0) {
            return null;
        }

        return $links[0];
    }

    /**
     * Get all links with the given relation and type, highest priority first.
     *
     * @param string  $rel          Relation name
     * @param string  $type         MIME Type
     * @param boolean $typeFallback When true and no link with the given type
     *                              could be found, the best link without a
     *                              type will be returned
     *
     * @return array Array of XML_XRD_Element_Link objects
     */
    public function getAll($rel, $type = null, $typeFallback = true)
    {
        $links = array();
        $exactType = false;
        foreach ($this->links as $link) {
            if ($link->rel == $rel
                && ($type === null || $link->type == $type
                || $typeFallback && $link->type === null)
            ) {
                $links[]    = $link;
                $exactType |= $typeFallback && $type !== null
                    && $link->type == $type;
            }
        }
        if ($exactType) {
            //remove all links without type
            $exactlinks = array();
            foreach ($links as $link) {
                if ($link->type !== null) {
                    $exactlinks[] = $link;
                }
            }
            $links = $exactlinks;
        }
        return $links;
    }

    /**
     * Return the iterator object to loop over the links
     *
     * Part of the IteratorAggregate interface
     *
     * @return Traversable Iterator for the links
     */
    public function getIterator()
    {
        return new ArrayIterator($this->links);
    }

    /**
     * Converts this XRD object to XML or JSON.
     *
     * @param string $type Serialization type: xml or json
     *
     * @return string Generated content
     */
    public function to($type)
    {
        if (!isset($this->serializer)) {
            $this->serializer = new XML_XRD_Serializer($this);
        }
        return $this->serializer->to($type);
    }

    /**
     * Converts this XRD object to XML.
     *
     * @return string Generated XML
     *
     * @deprecated use to('xml')
     */
    public function toXML()
    {
        return $this->to('xml');
    }
}
?>


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

require_once 'XML/XRD/PropertyAccess.php';

/**
 * Link element in a XRD file. Attribute access via object properties.
 *
 * Retrieving the title of a link is possible with the getTitle() convenience
 * method.
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
class XML_XRD_Element_Link extends XML_XRD_PropertyAccess
{
    /**
     * Link relation
     *
     * @var string
     */
    public $rel;

    /**
     * Link type (MIME type)
     *
     * @var string
     */
    public $type;

    /**
     * Link URL
     *
     * @var string
     */
    public $href;

    /**
     * Link URL template
     *
     * @var string
     */
    public $template;

    /**
     * Array of key-value pairs: Key is the language, value the title
     *
     * @var array
     */
    public $titles = array();

    /**
     * Create a new instance and load data from the XML element
     *
     * @param string  $relOrXml   string with the relation name/URL
     * @param string  $href       HREF value
     * @param string  $type       Type value
     * @param boolean $isTemplate When set to true, the $href is
     *                            used as template
     */
    public function __construct(
        $rel = null, $href = null, $type = null, $isTemplate = false
    ) {
        $this->rel = $rel;
        if ($isTemplate) {
            $this->template = $href;
        } else {
            $this->href = $href;
        }
        $this->type = $type;
    }

    /**
     * Returns the title of the link in the given language.
     * If the language is not available, the first title without the language
     * is returned. If no such one exists, the first title is returned.
     *
     * @param string $lang 2-letter language name
     *
     * @return string|null Link title
     */
    public function getTitle($lang = null)
    {
        if (count($this->titles) == 0) {
            return null;
        }

        if ($lang == null) {
            return reset($this->titles);
        }

        if (isset($this->titles[$lang])) {
            return $this->titles[$lang];
        }
        if (isset($this->titles[''])) {
            return $this->titles[''];
        }

        //return first
        return reset($this->titles);
    }
}

?>


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

/**
 * Property element in a XRD document.
 *
 * The <XRD> root element as well as <Link> tags may have <Property> children.
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
class XML_XRD_Element_Property
{
    /**
     * Value of the property.
     *
     * @var string|null
     */
    public $value;

    /**
     * Type of the propery.
     *
     * @var string
     */
    public $type;

    /**
     * Create a new instance
     *
     * @param string $type  String representing the property type
     * @param string $value Value of the property, may be NULL
     */
    public function __construct($type = null, $value = null)
    {
        $this->type  = $type;
        $this->value = $value;
    }
}

?>


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

/**
 * Base exception interface for all XML_XRD related exceptions.
 * With that interface, it is possible to catch all XML_XRD exceptions
 * with a single catch statement.
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
interface XML_XRD_Exception
{
}

?>


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

require_once 'XML/XRD/Loader/Exception.php';

/**
 * File/string loading dispatcher.
 * Loads the correct loader for the type of XRD file (XML or JSON).
 * Also provides type auto-detection.
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
class XML_XRD_Loader
{
    public function __construct(XML_XRD $xrd)
    {
        $this->xrd = $xrd;
    }

    /**
     * Loads the contents of the given file.
     *
     * Note: Only use file type auto-detection for local files.
     * Do not use it on remote files as the file gets requested several times.
     *
     * @param string $file Path to an XRD file
     * @param string $type File type: xml or json, NULL for auto-detection
     *
     * @return void
     *
     * @throws XML_XRD_Loader_Exception When the file is invalid or cannot be
     *                                   loaded
     */
    public function loadFile($file, $type = null)
    {
        if ($type === null) {
            $type = $this->detectTypeFromFile($file);
        }
        $loader = $this->getLoader($type);
        $loader->loadFile($file);
    }

    /**
     * Loads the contents of the given string
     *
     * @param string $str  XRD string
     * @param string $type File type: xml or json, NULL for auto-detection
     *
     * @return void
     *
     * @throws XML_XRD_Loader_Exception When the string is invalid or cannot be
     *                                   loaded
     */
    public function loadString($str, $type = null)
    {
        if ($type === null) {
            $type = $this->detectTypeFromString($str);
        }
        $loader = $this->getLoader($type);
        $loader->loadString($str);
    }

    /**
     * Creates a XRD loader object for the given type
     *
     * @param string $type File type: xml or json
     *
     * @return XML_XRD_Loader
     */
    protected function getLoader($type)
    {
        $class = 'XML_XRD_Loader_' . strtoupper($type);
        $file = str_replace('_', '/', $class) . '.php';
        include_once $file;
        if (class_exists($class)) {
            return new $class($this->xrd);
        }

        throw new XML_XRD_Loader_Exception(
            'No loader for XRD type "' . $type . '"',
            XML_XRD_Loader_Exception::NO_LOADER
        );
    }

    /**
     * Tries to detect the file type (xml or json) from the file content
     *
     * @param string $file File name to check
     *
     * @return string File type ('xml' or 'json')
     *
     * @throws XML_XRD_Loader_Exception When opening the file fails.
     */
    public function detectTypeFromFile($file)
    {
        if (!file_exists($file)) {
            throw new XML_XRD_Loader_Exception(
                'Error loading XRD file: File does not exist',
                XML_XRD_Loader_Exception::OPEN_FILE
            );
        }
        $handle = fopen($file, 'r');
        if (!$handle) {
            throw new XML_XRD_Loader_Exception(
                'Cannot open file to determine type',
                XML_XRD_Loader_Exception::OPEN_FILE
            );
        }

        $str = (string)fgets($handle, 10);
        fclose($handle);
        return $this->detectTypeFromString($str);
    }

    /**
     * Tries to detect the file type from the content of the file
     *
     * @param string $str Content of XRD file
     *
     * @return string File type ('xml' or 'json')
     *
     * @throws XML_XRD_Loader_Exception When the type cannot be detected
     */
    public function detectTypeFromString($str)
    {
        if (substr($str, 0, 1) == '{') {
            return 'json';
        } else if (substr($str, 0, 5) == '<?xml') {
            return 'xml';
        }

        throw new XML_XRD_Loader_Exception(
            'Detecting file type failed',
            XML_XRD_Loader_Exception::DETECT_TYPE
        );
    }

}

?>


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

require_once 'XML/XRD/Exception.php';

/**
 * XML_XRD exception that's thrown when loading the XRD fails.
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
class XML_XRD_Loader_Exception extends Exception implements XML_XRD_Exception
{
    /**
     * The document namespace is not the XRD 1.0 namespace
     */
    const DOC_NS = 10;

    /**
     * The document root element is not XRD
     */
    const DOC_ROOT = 11;

    /**
     * Error loading the XML|JSON file|string
     */
    const LOAD = 12;

    /**
     * Unsupported XRD file/string type (no loader)
     */
    const NO_LOADER = 13;

    /**
     * Error opening file
     */
    const OPEN_FILE = 14;

    /**
     * Detecting the file type failed
     */
    const DETECT_TYPE = 20;
}

?>


code:
<?php
/**
 * Part of XML_XRD
 *
 * PHP version 5
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @link     http://pear.php.net/package/XML_XRD
 */

/**
 * Loads XRD data from a JSON file
 *
 * @category XML
 * @package  XML_XRD
 * @author   Christian Weiske <cweiske@php.net>
 * @license  http://www.gnu.org/copyleft/lesser.html LGPL
 * @version  Release: @package_version@
 * @link     http://pear.php.net/package/XML_XRD
 */
class XML_XRD_Loader_JSON
{
    /**
     * Data storage the XML data get loaded into
     *
     * @var XML_XRD
     */
    protected $xrd;

    /**
     * Init object with xrd object
     *
     * @param XML_XRD $xrd Data storage the JSON data get loaded into
     */
    public function __construct(XML_XRD $xrd)
    {
        $this->xrd = $xrd;
    }

    /**
     * Loads the contents of the given file
     *
     * @param string $file Path to an JRD file
     *
     * @return void
     *
     * @throws XML_XRD_Loader_Exception When the JSON is invalid or cannot be
     *                                   loaded
     */
    public function loadFile($file)
    {
        $json = file_get_contents($file);
        if ($json === false) {
            throw new XML_XRD_Loader_Exception(
                'Error loading JRD file: ' . $file,
                XML_XRD_Loader_Exception::LOAD
            );
        }
        return $this->loadString($json);
    }

    /**
     * Loads the contents of the given string
     *
     * @param string $json JSON string
     *
     * @return void
     *
     * @throws XML_XRD_Loader_Exception When the JSON is invalid or cannot be
     *                                   loaded
     */
    public function loadString($json)
    {
        if ($json == '') {
            throw new XML_XRD_Loader_Exception(
                'Error loading JRD: string empty',
                XML_XRD_Loader_Exception::LOAD
            );
        }

        $obj = json_decode($json);
        if ($obj !== null) {
            return $this->load($obj);
        }

        $constants = get_defined_constants(true);
        $json_errors = array();
        foreach ($constants['json'] as $name => $value) {
            if (!strncmp($name, 'JSON_ERROR_', 11)) {
                $json_errors[$value] = $name;
            }
        }
        throw new XML_XRD_Loader_Exception(
            'Error loading JRD: ' . $json_errors[json_last_error()],
            XML_XRD_Loader_Exception::LOAD
        );
    }

    /**
     * Loads the JSON object into the classes' data structures
     *
     * @param object $j JSON object containing the whole JSON document
     *
     * @return void
     */
    public function load(stdClass $j)
    {
        if (isset($j->subject)) {
            $this->xrd->subject = (string)$j->subject;
        }
        if (isset($j->aliases)) {
            foreach ($j->aliases as $jAlias) {
                $this->xrd->aliases[] = (string)$jAlias;
            }
        }

        if (isset($j->links)) {
            foreach ($j->links as $jLink) {
                $this->xrd->links[] = $this->loadLink($jLink);
            }
        }

        $this->loadProperties($this->xrd, $j);

        if (isset($j->expires)) {
            $this->xrd->expires = strtotime($j->expires);
        }
    }

    /**
     * Loads the Property elements from XML
     *
     * @param object $store Data store where the properties get stored
     * @param object $j     JSON element with "properties" variable
     *
     * @return boolean True when all went well
     */
    protected function loadProperties(
        XML_XRD_PropertyAccess $store, stdClass $j
    ) {
        if (!isset($j->properties)) {
            return true;
        }

        foreach ($j->properties as $type => $jProp) {
            $store->properties[] = new XML_XRD_Element_Property(
                $type, (string)$jProp
            );
        }

        return true;
    }

    /**
     * Create a link element object from XML element
     *
     * @param object $j JSON link object
     *
     * @return XML_XRD_Element_Link Created link object
     */
    protected function loadLink(stdClass $j)
    {
        $link = new XML_XRD_Element_Link();
        foreach (array('rel', 'type', 'href', 'template') as $var) {
            if (isset($j->$var)) {
                $link->$var = (string)$j->$var;
            }
        }

        if (isset($j->titles)) {
            foreach ($j->titles as $lang => $jTitle) {
                if (!isset($link->titles[$lang])) {
                    $link->titles[$lang] = (string)$jTitle;
                }
            }
        }
        $this->loadProperties($link, $j);

        return $link;
    }
}
?>