aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-12 20:38:42 -0800
committerfriendica <info@friendica.com>2013-01-12 20:38:42 -0800
commitc0c5252b57fdd6a7687aec02411a899a54021af6 (patch)
tree63e5b4ed9ed9af8d5059976fcaa20b4f88ef3516 /util
parent99ff0f51a83a553051211a186d9162669636d931 (diff)
downloadvolse-hubzilla-c0c5252b57fdd6a7687aec02411a899a54021af6.tar.gz
volse-hubzilla-c0c5252b57fdd6a7687aec02411a899a54021af6.tar.bz2
volse-hubzilla-c0c5252b57fdd6a7687aec02411a899a54021af6.zip
fresh: provide ability to change channels
Diffstat (limited to 'util')
-rwxr-xr-xutil/fresh18
1 files changed, 17 insertions, 1 deletions
diff --git a/util/fresh b/util/fresh
index 2cbba81cd..2314796bb 100755
--- a/util/fresh
+++ b/util/fresh
@@ -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;