+ $source = $_REQUEST['source'] ?? '';
+
+ // Support for known clients that doesn't send a source name
+ if (empty($source) && !empty($_SERVER['HTTP_USER_AGENT'])) {
+ if(strpos($_SERVER['HTTP_USER_AGENT'], "Twidere") !== false) {
+ $source = 'Twidere';
+ }
+
+ Logger::info('Unrecognized user-agent', ['http_user_agent' => $_SERVER['HTTP_USER_AGENT']]);
+ } else {
+ Logger::info('Empty user-agent');
+ }
+
+ if (empty($source)) {
+ $source = 'api';
+ }
+