From a7c82d2cc2124f16fcb60fa051d377979f65a710 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 7 Sep 2017 18:13:38 +0200 Subject: [PATCH] Add visibility and preset options for create-room --- scripts/patrix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/patrix b/scripts/patrix index 6557a58..a1651dd 100644 --- a/scripts/patrix +++ b/scripts/patrix @@ -30,6 +30,8 @@ GetOptions( "name=s" => \$opt->{name}, "alias=s" => \$opt->{alias}, "topic=s" => \$opt->{topic}, + "preset=s" => \$opt->{preset}, + "visibility=s" => \$opt->{visibility} ); if (-e File::HomeDir->my_home . "/.patrixrc" && !$opt->{conf}){ @@ -280,10 +282,12 @@ sub create_room { my $uri = $opt->{server} . '/_matrix/client/r0/createRoom?access_token=' . $opt->{access_token}; my $req = HTTP::Request->new( 'POST', $uri ); my $json = {}; - $json->{room_alias_name} = $opt->{alias} if $opt->{alias}; - $json->{topic} = $opt->{topic} if $opt->{topic}; - $json->{name} = $opt->{name} if $opt->{name}; - $json->{invite} = $opt->{invite} if $opt->{invite}; + $json->{room_alias_name} = $opt->{alias} if $opt->{alias}; + $json->{topic} = $opt->{topic} if $opt->{topic}; + $json->{name} = $opt->{name} if $opt->{name}; + $json->{invite} = $opt->{invite} if $opt->{invite}; + $json->{preset} = $opt->{preset} if $opt->{preset}; + $json->{visibility} = $opt->{visibility} if $opt->{visbility}; $req->header( 'Content-Type' => 'application/json' ); $req->content( to_json($json) ); my $resp = $lwp->request( $req );