summaryrefslogtreecommitdiff
path: root/lib/apiaction.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/apiaction.php')
-rw-r--r--lib/apiaction.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/apiaction.php b/lib/apiaction.php
index 59dc47c23..f87b04611 100644
--- a/lib/apiaction.php
+++ b/lib/apiaction.php
@@ -63,9 +63,12 @@ class ApiAction extends Action
var $count = null;
var $max_id = null;
var $since_id = null;
+ var $source = null;
var $access = self::READ_ONLY; // read (default) or read-write
+ static $reserved_sources = array('web', 'omb', 'ostatus', 'mail', 'xmpp', 'api');
+
/**
* Initialization.
*
@@ -89,6 +92,12 @@ class ApiAction extends Action
header('X-StatusNet-Warning: since parameter is disabled; use since_id');
}
+ $this->source = $this->trimmed('source');
+
+ if (empty($this->source) || in_array($this->source, self::$reserved_sources)) {
+ $this->source = 'api';
+ }
+
return true;
}