From fc7d0360bb059bf87c5c531a2bfd5bcee3aef3f6 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Jan 2012 20:26:20 -0800 Subject: [PATCH] add verb and item to notifications to aid in localisation --- boot.php | 6 +++--- database.sql | 17 +++++++++++++++++ include/diaspora.php | 2 ++ include/items.php | 16 +++++++++++++--- mod/dfrn_request.php | 4 +++- mod/item.php | 8 ++++++-- update.php | 20 +++++++++++++++++++- 7 files changed, 63 insertions(+), 10 deletions(-) diff --git a/boot.php b/boot.php index df9daf4835..61deae18b7 100644 --- a/boot.php +++ b/boot.php @@ -4,14 +4,14 @@ require_once('include/config.php'); require_once('include/network.php'); require_once('include/plugin.php'); require_once('include/text.php'); -require_once("include/pgettext.php"); +require_once('include/pgettext.php'); require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_VERSION', '2.3.1215' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1114 ); +define ( 'DB_UPDATE_VERSION', 1115 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -103,7 +103,7 @@ define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API define ( 'NETWORK_LINKEDIN', 'lnkd'); // LinkedIn define ( 'NETWORK_XMPP', 'xmpp'); // XMPP - +define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace /** * Maximum number of "people who like (or don't like) this" that we will list by name diff --git a/database.sql b/database.sql index 4dc1973ed5..6826aa6f89 100644 --- a/database.sql +++ b/database.sql @@ -751,3 +751,20 @@ INDEX ( `uid` ), INDEX ( `seen` ), INDEX ( `date` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `item_id` ( +`iid` INT NOT NULL , +`uid` INT NOT NULL , +`face` CHAR( 255 ) NOT NULL , +`dspr` CHAR( 255 ) NOT NULL , +`twit` CHAR( 255 ) NOT NULL , +`stat` CHAR( 255 ) NOT NULL , +PRIMARY KEY ( `iid` ), +INDEX ( `uid` ), +INDEX ( `face` ), +INDEX ( `dspr` ), +INDEX ( `twit` ), +INDEX ( `stat` ) +) ENGINE = MyISAM DEFAULT CHARSET=utf8; + + diff --git a/include/diaspora.php b/include/diaspora.php index 2d139c77c3..25ca11ed03 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1235,6 +1235,8 @@ function diaspora_conversation($importer,$xml,$msg) { 'source_name' => $person['name'], 'source_link' => $person['url'], 'source_photo' => $person['thumb'], + 'verb' => ACTIVITY_POST, + 'otype' => 'mail' )); } diff --git a/include/items.php b/include/items.php index 9f006306f8..a63468d925 100644 --- a/include/items.php +++ b/include/items.php @@ -1798,7 +1798,9 @@ function local_delivery($importer,$data) { 'link' => $a->get_baseurl() . '/notifications/intros', 'source_name' => $importer['name'], 'source_link' => $importer['url'], - 'source_photo' => $importer['photo'] + 'source_photo' => $importer['photo'], + 'verb' => ACTIVITY_REQ_FRIEND, + 'otype' => 'intro' )); return 0; @@ -1847,6 +1849,8 @@ function local_delivery($importer,$data) { 'source_name' => $msg['from-name'], 'source_link' => $importer['url'], 'source_photo' => $importer['thumb'], + 'verb' => ACTIVITY_POST, + 'otype' => 'mail' ); notification($notif_params); @@ -2118,7 +2122,10 @@ function local_delivery($importer,$data) { 'source_name' => stripslashes($datarray['author-name']), 'source_link' => $datarray['author-link'], 'source_photo' => ((link_compare($datarray['author-link'],$importer['url'])) - ? $importer['thumb'] : $datarray['author-avatar']) + ? $importer['thumb'] : $datarray['author-avatar']), + 'verb' => ACTIVITY_POST, + 'otype' => 'item' + )); } @@ -2234,7 +2241,10 @@ function local_delivery($importer,$data) { 'source_name' => stripslashes($datarray['author-name']), 'source_link' => $datarray['author-link'], 'source_photo' => ((link_compare($datarray['author-link'],$importer['url'])) - ? $importer['thumb'] : $datarray['author-avatar']) + ? $importer['thumb'] : $datarray['author-avatar']), + 'verb' => ACTIVITY_POST, + 'otype' => 'item' + )); break; diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index a968604039..aa14bc473d 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -580,7 +580,9 @@ function dfrn_request_content(&$a) { 'link' => $a->get_baseurl() . '/notifications/intros', 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), 'source_link' => $r[0]['url'], - 'source_photo' => $r[0]['photo'] + 'source_photo' => $r[0]['photo'], + 'verb' => ACTIVITY_REQ_FRIEND, + 'otype' => 'intro' )); } diff --git a/mod/item.php b/mod/item.php index ece92f0f3d..c4e66ebeb0 100644 --- a/mod/item.php +++ b/mod/item.php @@ -691,7 +691,9 @@ function item_post(&$a) { 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], - 'source_photo' => $datarray['author-avatar'] + 'source_photo' => $datarray['author-avatar'], + 'verb' => ACTIVITY_POST, + 'otype' => 'item' )); } @@ -731,7 +733,9 @@ function item_post(&$a) { 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], - 'source_photo' => $datarray['author-avatar'] + 'source_photo' => $datarray['author-avatar'], + 'verb' => ACTIVITY_POST, + 'otype' => 'item' )); } } diff --git a/update.php b/update.php index 6eade22f70..4dff59c984 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@