summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api.php27
-rw-r--r--lib/language.php1
2 files changed, 22 insertions, 6 deletions
diff --git a/lib/api.php b/lib/api.php
index eacb80dbe..7ebe65dbb 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -134,17 +134,19 @@ class ApiAction extends Action
$twitter_user['protected'] = false; # not supported by StatusNet yet
$twitter_user['followers_count'] = $profile->subscriberCount();
- $user = $profile->getUser();
$design = null;
+ $user = $profile->getUser();
// Note: some profiles don't have an associated user
- $defaultDesign = Design::siteDesign();
-
if (!empty($user)) {
$design = $user->getDesign();
}
+ if (empty($design)) {
+ $design = Design::siteDesign();
+ }
+
$color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor);
$twitter_user['profile_background_color'] = ($color == null) ? '' : '#'.$color->hexValue();
$color = Design::toWebColor(empty($design->textcolor) ? $defaultDesign->textcolor : $design->textcolor);
@@ -163,7 +165,7 @@ class ApiAction extends Action
$timezone = 'UTC';
- if (!empty($user) && !empty($user->timezone)) {
+ if ($user->timezone) {
$timezone = $user->timezone;
}
@@ -586,7 +588,7 @@ class ApiAction extends Action
$this->endDocument('xml');
}
- function showRssTimeline($notice, $title, $link, $subtitle, $suplink=null)
+ function showRssTimeline($notice, $title, $link, $subtitle, $suplink=null, $logo=null)
{
$this->initDocument('rss');
@@ -600,6 +602,15 @@ class ApiAction extends Action
'href' => $suplink,
'type' => 'application/json'));
}
+
+ if (!is_null($logo)) {
+ $this->elementStart('image');
+ $this->element('link', null, $link);
+ $this->element('title', null, $title);
+ $this->element('url', null, $logo);
+ $this->elementEnd('image');
+ }
+
$this->element('description', null, $subtitle);
$this->element('language', null, 'en-us');
$this->element('ttl', null, '40');
@@ -619,7 +630,7 @@ class ApiAction extends Action
$this->endTwitterRss();
}
- function showAtomTimeline($notice, $title, $id, $link, $subtitle=null, $suplink=null, $selfuri=null)
+ function showAtomTimeline($notice, $title, $id, $link, $subtitle=null, $suplink=null, $selfuri=null, $logo=null)
{
$this->initDocument('atom');
@@ -628,6 +639,10 @@ class ApiAction extends Action
$this->element('id', null, $id);
$this->element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
+ if (!is_null($logo)) {
+ $this->element('logo',null,$logo);
+ }
+
if (!is_null($suplink)) {
# For FriendFeed's SUP protocol
$this->element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
diff --git a/lib/language.php b/lib/language.php
index 916cee7ed..c037d30c3 100644
--- a/lib/language.php
+++ b/lib/language.php
@@ -272,6 +272,7 @@ function get_nice_language_list()
function get_all_languages() {
return array(
'ar' => array('q' => 0.8, 'lang' => 'ar', 'name' => 'Arabic', 'direction' => 'rtl'),
+ 'arz' => array('q' => 0.8, 'lang' => 'arz', 'name' => 'Egyptian Spoken Arabic', 'direction' => 'rtl'),
'bg' => array('q' => 0.8, 'lang' => 'bg', 'name' => 'Bulgarian', 'direction' => 'ltr'),
'ca' => array('q' => 0.5, 'lang' => 'ca', 'name' => 'Catalan', 'direction' => 'ltr'),
'cs' => array('q' => 0.5, 'lang' => 'cs', 'name' => 'Czech', 'direction' => 'ltr'),