diff options
author | Matthew Hodgson <matthew@matrix.org> | 2015-03-14 00:09:21 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2015-03-14 00:09:21 +0000 |
commit | 256fe08963895cf1078f4f57c1c2673529fa25cd (patch) | |
tree | 9025c78b31cfcaf3e6231ff10401fbe4c620da49 /contrib/vertobot/bridge.pl | |
parent | Merge pull request #108 from matrix-org/metrics (diff) | |
download | synapse-256fe08963895cf1078f4f57c1c2673529fa25cd.tar.xz |
uncommited WIP from MWC
Diffstat (limited to 'contrib/vertobot/bridge.pl')
-rwxr-xr-x | contrib/vertobot/bridge.pl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/contrib/vertobot/bridge.pl b/contrib/vertobot/bridge.pl index e1a07f6659..a551850f40 100755 --- a/contrib/vertobot/bridge.pl +++ b/contrib/vertobot/bridge.pl @@ -86,7 +86,7 @@ sub create_virtual_user "user": "$localpart" } EOT - )->get; + )->get; warn $response->as_string if ($response->code != 200); } @@ -266,17 +266,21 @@ my $as_url = $CONFIG{"matrix-bot"}->{as_url}; Future->needs_all( $http->do_request( - method => "POST", - uri => URI->new( $CONFIG{"matrix"}->{server}."/_matrix/appservice/v1/register" ), - content_type => "application/json", - content => <<EOT + method => "POST", + uri => URI->new( $CONFIG{"matrix"}->{server}."/_matrix/appservice/v1/register" ), + content_type => "application/json", + content => <<EOT { "as_token": "$as_token", "url": "$as_url", - "namespaces": { "users": ["\@\\\\+.*"] } + "namespaces": { "users": [ { "regex": "\@\\\\+.*", "exclusive": false } ] } } EOT - ), + )->then( sub{ + my ($response) = (@_); + warn $response->as_string if ($response->code != 200); + return Future->done; + }), $verto_connecting, )->get; |