fresh: provide ability to change channels

This commit is contained in:
friendica 2013-01-12 20:38:42 -08:00
parent 99ff0f51a8
commit c0c5252b57

View File

@ -92,7 +92,23 @@ function process_command($line) {
}
break;
case 'channel':
if(! local_user())
echo 'Permission denied.';
if(argv(1)) {
$r = q("select * from channel where channel_address = '%s' and channel_account_id = %d limit 1",
dbesc(argv(1)),
intval(get_account_id())
);
if($r) {
change_channel($r[0]['channel_id']);
$channel = $a->get_channel();
echo 'Logged in as ' . $channel['channel_name'];
}
else
echo 'Channel not found.';
}
break;
default:
break;