Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
9fa8bda0
Commit
9fa8bda0
authored
9 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into application-services-registration-script
parents
5e88a09a
09cbff17
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.rst
+7
-0
7 additions, 0 deletions
CHANGES.rst
synapse/appservice/__init__.py
+4
-1
4 additions, 1 deletion
synapse/appservice/__init__.py
tests/appservice/test_appservice.py
+13
-0
13 additions, 0 deletions
tests/appservice/test_appservice.py
with
24 additions
and
1 deletion
CHANGES.rst
+
7
−
0
View file @
9fa8bda0
Changes in synapse vX
=====================
* Changed config option from ``disable_registration`` to
``enable_registration``. Old option will be ignored.
Changes in synapse v0.8.1 (2015-03-18)
======================================
...
...
This diff is collapsed.
Click to expand it.
synapse/appservice/__init__.py
+
4
−
1
View file @
9fa8bda0
...
...
@@ -199,7 +199,10 @@ class ApplicationService(object):
return
self
.
_matches_user
(
event
,
member_list
)
def
is_interested_in_user
(
self
,
user_id
):
return
self
.
_matches_regex
(
user_id
,
ApplicationService
.
NS_USERS
)
return
(
self
.
_matches_regex
(
user_id
,
ApplicationService
.
NS_USERS
)
or
user_id
==
self
.
sender
)
def
is_interested_in_alias
(
self
,
alias
):
return
self
.
_matches_regex
(
alias
,
ApplicationService
.
NS_ALIASES
)
...
...
This diff is collapsed.
Click to expand it.
tests/appservice/test_appservice.py
+
13
−
0
View file @
9fa8bda0
...
...
@@ -199,6 +199,19 @@ class ApplicationServiceTestCase(unittest.TestCase):
aliases_for_event
=
[
"
#xmpp_barfoo:matrix.org
"
]
))
def
test_interested_in_self
(
self
):
# make sure invites get through
self
.
service
.
sender
=
"
@appservice:name
"
self
.
service
.
namespaces
[
ApplicationService
.
NS_USERS
].
append
(
_regex
(
"
@irc_.*
"
)
)
self
.
event
.
type
=
"
m.room.member
"
self
.
event
.
content
=
{
"
membership
"
:
"
invite
"
}
self
.
event
.
state_key
=
self
.
service
.
sender
self
.
assertTrue
(
self
.
service
.
is_interested
(
self
.
event
))
def
test_member_list_match
(
self
):
self
.
service
.
namespaces
[
ApplicationService
.
NS_USERS
].
append
(
_regex
(
"
@irc_.*
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment