Merge pull request #221 from gerhard6380/windowsphonepush
authorfabrixxm <fabrix.xm@gmail.com>
Fri, 31 Oct 2014 13:41:36 +0000 (14:41 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Fri, 31 Oct 2014 13:41:36 +0000 (14:41 +0100)
Addon WindowsPhonePush

appnet/lang/pt-br/messages.po [new file with mode: 0644]
appnet/lang/pt-br/strings.php [new file with mode: 0644]
statusnet/statusnet.php
twitter/twitter.php

diff --git a/appnet/lang/pt-br/messages.po b/appnet/lang/pt-br/messages.po
new file mode 100644 (file)
index 0000000..cf67762
--- /dev/null
@@ -0,0 +1,118 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+# 
+# 
+# Translators:
+# Calango Jr <jcsojr@gmail.com>, 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2014-10-04 04:09+0000\n"
+"Last-Translator: Calango Jr <jcsojr@gmail.com>\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/friendica/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Permissão negada."
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Você está autenticado no app.net."
+
+#: appnet.php:77
+msgid "<p>Error fetching token. Please try again.</p>"
+msgstr "Erro ocorrido na obtenção do token. Tente novamente."
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "Volte a página de conectores."
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Postar no app.net"
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "App.net exportar"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "Atualmente conectado em: "
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "Habilitar App.net Plugin de publicação/postagem"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Postar em App.net por padrão"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "Importar timeline remota"
+
+#: appnet.php:159
+msgid ""
+"<p>Error fetching user profile. Please clear the configuration and try "
+"again.</p>"
+msgstr "Erro na obtenção do perfil do usuário. Confira as configurações e tente novamente."
+
+#: appnet.php:164
+msgid "<p>You have two ways to connect to App.net.</p>"
+msgstr "<p>Você possui duas formas de conectar ao App.net</p>"
+
+#: appnet.php:166
+msgid ""
+"<p>First way: Register an application at <a "
+"href=\"https://account.app.net/developer/apps/\">https://account.app.net/developer/apps/</a>"
+" and enter Client ID and Client Secret. "
+msgstr "<p>1º Método: Registre uma aplicação em <a href=\"https://account.app.net/developer/apps/\">https://account.app.net/developer/apps/</a> e entre o Client ID e Client Secret"
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI<p>"
+msgstr "Use '%s' como URI redirecionador<p>"
+
+#: appnet.php:169
+msgid "Client ID"
+msgstr "Client ID"
+
+#: appnet.php:173
+msgid "Client Secret"
+msgstr "Client Secret"
+
+#: appnet.php:177
+msgid ""
+"<p>Second way: fetch a token at <a href=\"http://dev-"
+"lite.jonathonduerig.com/\">http://dev-lite.jonathonduerig.com/</a>. "
+msgstr "<p>2º Método: obtenha um token em <a href=\"http://dev-lite.jonathonduerig.com/\">http://dev-lite.jonathonduerig.com/</a>. "
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.</p>"
+msgstr "Adicione valor as estas saídas: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.</p>"
+
+#: appnet.php:180
+msgid "Token"
+msgstr "Token"
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr "Registre-se usando App.net"
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr "Limpar configuração OAuth"
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr "Salvar Configurações"
diff --git a/appnet/lang/pt-br/strings.php b/appnet/lang/pt-br/strings.php
new file mode 100644 (file)
index 0000000..6d4a410
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+if(! function_exists("string_plural_select_pt_br")) {
+function string_plural_select_pt_br($n){
+       return ($n > 1);;
+}}
+;
+$a->strings["Permission denied."] = "Permissão negada.";
+$a->strings["You are now authenticated to app.net. "] = "Você está autenticado no app.net.";
+$a->strings["<p>Error fetching token. Please try again.</p>"] = "Erro ocorrido na obtenção do token. Tente novamente.";
+$a->strings["return to the connector page"] = "Volte a página de conectores.";
+$a->strings["Post to app.net"] = "Postar no app.net";
+$a->strings["App.net Export"] = "App.net exportar";
+$a->strings["Currently connected to: "] = "Atualmente conectado em: ";
+$a->strings["Enable App.net Post Plugin"] = "Habilitar App.net Plugin de publicação/postagem";
+$a->strings["Post to App.net by default"] = "Postar em App.net por padrão";
+$a->strings["Import the remote timeline"] = "Importar timeline remota";
+$a->strings["<p>Error fetching user profile. Please clear the configuration and try again.</p>"] = "Erro na obtenção do perfil do usuário. Confira as configurações e tente novamente.";
+$a->strings["<p>You have two ways to connect to App.net.</p>"] = "<p>Você possui duas formas de conectar ao App.net</p>";
+$a->strings["<p>First way: Register an application at <a href=\"https://account.app.net/developer/apps/\">https://account.app.net/developer/apps/</a> and enter Client ID and Client Secret. "] = "<p>1º Método: Registre uma aplicação em <a href=\"https://account.app.net/developer/apps/\">https://account.app.net/developer/apps/</a> e entre o Client ID e Client Secret";
+$a->strings["Use '%s' as Redirect URI<p>"] = "Use '%s' como URI redirecionador<p>";
+$a->strings["Client ID"] = "Client ID";
+$a->strings["Client Secret"] = "Client Secret";
+$a->strings["<p>Second way: fetch a token at <a href=\"http://dev-lite.jonathonduerig.com/\">http://dev-lite.jonathonduerig.com/</a>. "] = "<p>2º Método: obtenha um token em <a href=\"http://dev-lite.jonathonduerig.com/\">http://dev-lite.jonathonduerig.com/</a>. ";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.</p>"] = "Adicione valor as estas saídas: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.</p>";
+$a->strings["Token"] = "Token";
+$a->strings["Sign in using App.net"] = "Registre-se usando App.net";
+$a->strings["Clear OAuth configuration"] = "Limpar configuração OAuth";
+$a->strings["Save Settings"] = "Salvar Configurações";
index c359135..ce8d170 100644 (file)
@@ -872,6 +872,9 @@ function statusnet_address($contact) {
 }
 
 function statusnet_fetch_contact($uid, $contact, $create_user) {
+       if ($contact->statusnet_profile_url == "")
+               return(-1);
+
        // Check if the unique contact is existing
        // To-Do: only update once a while
         $r = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
@@ -950,16 +953,12 @@ function statusnet_fetch_contact($uid, $contact, $create_user) {
                q("UPDATE `contact` SET `photo` = '%s',
                                        `thumb` = '%s',
                                        `micro` = '%s',
-                                       `name-date` = '%s',
-                                       `uri-date` = '%s',
                                        `avatar-date` = '%s'
                                WHERE `id` = %d",
                        dbesc($photos[0]),
                        dbesc($photos[1]),
                        dbesc($photos[2]),
                        dbesc(datetime_convert()),
-                       dbesc(datetime_convert()),
-                       dbesc(datetime_convert()),
                        intval($contact_id)
                );
 
@@ -971,7 +970,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) {
 
                // check that we have all the photos, this has been known to fail on occasion
 
-               if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro']) || ($update_photo)) {
+               if((!$r[0]['photo']) || (!$r[0]['thumb']) || (!$r[0]['micro']) || ($update_photo)) {
 
                        logger("statusnet_fetch_contact: Updating contact ".$contact->screen_name, LOGGER_DEBUG);
 
@@ -1338,7 +1337,16 @@ function statusnet_fetchhometimeline($a, $uid) {
        $items = $connection->get('statuses/home_timeline', $parameters);
 
        if (!is_array($items)) {
-               logger("statusnet_fetchhometimeline: Error fetching home timeline: ".print_r($items, true), LOGGER_DEBUG);
+               if (is_object($items) AND isset($items->error))
+                       $errormsg = $items->error;
+               elseif (is_object($items))
+                       $errormsg = print_r($items, true);
+               elseif (is_string($items) OR is_float($items) OR is_int($items))
+                       $errormsg = $items;
+               else
+                       $errormsg = "Unknown error";
+
+               logger("statusnet_fetchhometimeline: Error fetching home timeline: ".$errormsg, LOGGER_DEBUG);
                return;
        }
 
index 1919e28..2669c46 100644 (file)
@@ -892,6 +892,9 @@ function twitter_queue_hook(&$a,&$b) {
 function twitter_fetch_contact($uid, $contact, $create_user) {
        require_once("include/Photo.php");
 
+       if ($contact->id_str == "")
+               return(-1);
+
        $avatar = str_replace("_normal.", ".", $contact->profile_image_url_https);
 
        $info = get_photo_info($avatar);