summary refs log tree commit diff
path: root/contrib/vertobot/bridge.pl
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2015-03-14 00:09:21 +0000
committerMatthew Hodgson <matthew@matrix.org>2015-03-14 00:09:21 +0000
commit256fe08963895cf1078f4f57c1c2673529fa25cd (patch)
tree9025c78b31cfcaf3e6231ff10401fbe4c620da49 /contrib/vertobot/bridge.pl
parentMerge pull request #108 from matrix-org/metrics (diff)
downloadsynapse-256fe08963895cf1078f4f57c1c2673529fa25cd.tar.xz
uncommited WIP from MWC
Diffstat (limited to '')
-rwxr-xr-xcontrib/vertobot/bridge.pl18
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;