Jonathan de Jong
4b965c862d
Remove redundant "coding: utf-8" lines ( #9786 )
Part of #9744
Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now.
`Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
vor 3 Jahren
Jonathan de Jong
d6196efafc
Add ResponseCache tests. ( #9458 )
vor 3 Jahren
Eric Eastwood
0a00b7ff14
Update black, and run auto formatting over the codebase ( #9381 )
- Update black version to the latest
- Run black auto formatting over the codebase
- Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md)
- Update `code_style.md` docs around installing black to use the correct version
vor 3 Jahren
Brendan Abolivier
29ae04af3b
Remove unneeded type constraints on 3rd party protocol lookup responses
vor 3 Jahren
Will Hunt
c276bd9969
Send some ephemeral events to appservices ( #8437 )
Optionally sends typing, presence, and read receipt information to appservices.
vor 3 Jahren
Patrick Cloke
1781bbe319
Add type hints to response cache. ( #8507 )
vor 3 Jahren
Richard van der Hoff
11c9e17738
Add type annotations to SimpleHttpClient ( #8372 )
vor 3 Jahren
Patrick Cloke
8a4a4186de
Simplify super() calls to Python 3 syntax. ( #8344 )
This converts calls like super(Foo, self) -> super().
Generated with:
sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
vor 3 Jahren
Patrick Cloke
7d103a594e
Convert appservice code to async/await. ( #8207 )
vor 3 Jahren
Patrick Cloke
88a3ff12f0
Convert the SimpleHttpClient to async. ( #8016 )
vor 3 Jahren
Patrick Cloke
4cce8ef74e
Convert appservice to async. ( #7973 )
vor 3 Jahren
Sorunome
1bca21e1da
Include room states on invite events sent to ASes ( #6455 )
vor 3 Jahren
Patrick Cloke
6d687ebba1
Convert the appservice handler to async/await. ( #7775 )
vor 3 Jahren
Dagfinn Ilmari Mannsåker
a3f11567d9
Replace all remaining six usage with native Python 3 equivalents ( #7704 )
vor 3 Jahren
Andrew Morgan
3916e1b97a
Clean up newline quote marks around the codebase ( #6362 )
vor 4 Jahren
Andrew Morgan
2a44782666
Remove double return statements ( #5962 )
Remove all the "double return" statements which were a result of us removing all the instances of
```
defer.returnValue(...)
return
```
statements when we switched to python3 fully.
vor 4 Jahren
Amber Brown
4806651744
Replace returnValue with return ( #5736 )
vor 4 Jahren
Amber Brown
32e7c9e7f2
Run Black. ( #5482 )
vor 4 Jahren
Amber Brown
2d2828dcbc
Port http/ to Python 3 ( #3771 )
vor 5 Jahren
Amber Brown
49af402019
run isort
vor 5 Jahren
Will Hunt
d6e3c2c79b
Let's try labels instead of label, that might work
vor 6 Jahren
Will Hunt
604cff1a06
Add metrics to track appservice transactions
vor 6 Jahren
Richard van der Hoff
b78395b7fe
Refactor ResponseCache usage
Adds a `.wrap` method to ResponseCache which wraps up the boilerplate of a
(get, set) pair, and then use it throughout the codebase.
This will be largely non-functional, but does include the following functional
changes:
* federation_server.on_context_state_request: drops use of _server_linearizer
which looked redundant and could cause incorrect cache misses by yielding
between the get and the set.
* RoomListHandler.get_remote_public_room_list(): fixes logcontext leaks
* the wrap function includes some logging. I'm hoping this won't be too noisy
on production.
vor 6 Jahren
Richard van der Hoff
b3384232a0
Add metrics for ResponseCache
vor 6 Jahren
Erik Johnston
2a7e9faeec
Do logcontexts outside ResponseCache
vor 6 Jahren
Erik Johnston
2bf5a47b3e
Rename network_id to instance_id on client side
vor 7 Jahren
Erik Johnston
3727d66a0e
Don't include appservice id
vor 7 Jahren
Erik Johnston
f32fb65552
Add new API appservice specific public room list
vor 7 Jahren
Paul "LeoNerd" Evans
776594f99d
Log if rejecting 3PE query metadata result due to type check
vor 7 Jahren
Paul "LeoNerd" Evans
ed44c475d8
Reject malformed 3PE query metadata results earlier in AS API handling code
vor 7 Jahren
Kegan Dougal
572acde483
Use None instead of the empty string
Change how we validate the 'url' field as a result.
vor 7 Jahren
Kegan Dougal
16b652f0a3
Flake8
vor 7 Jahren
Kegan Dougal
e82247f990
Allow application services to have an optional 'url'
If 'url' is not specified, they will not be pushed for events or queries. This
is useful for bots who simply wish to reserve large chunks of user/alias
namespace, and don't care about being pushed for events.
vor 7 Jahren
Paul "LeoNerd" Evans
9459137f1e
Just sprintf the 'kind' argument into uri directly
vor 7 Jahren
Paul "LeoNerd" Evans
1294d4a329
Move ThirdPartyEntityKind into api.constants so the expectation becomes that the value is significant
vor 7 Jahren
Paul "LeoNerd" Evans
e7af8be5ae
Root the 3PE lookup API within /_matrix/app/unstable instead of at toplevel
vor 7 Jahren
Paul "LeoNerd" Evans
adf53f04ce
appease pep8
vor 7 Jahren
Paul "LeoNerd" Evans
db7283cc6b
Implement a ResponseCache around 3PE lookup metadata lookups
vor 7 Jahren
Paul "LeoNerd" Evans
d0b8d49f71
Kill PROTOCOL_META since I'm not using it any more
vor 7 Jahren
Paul "LeoNerd" Evans
5474824975
Actually query over AS API for 3PE lookup metadata
vor 7 Jahren
Paul "LeoNerd" Evans
63c19e1df9
Move 3PU/3PL lookup APIs into /thirdparty containing entity
vor 7 Jahren
Paul "LeoNerd" Evans
65201631a4
Move validation logic for AS 3PE query response into ApplicationServiceApi class, to keep the handler logic neater
vor 7 Jahren
Paul "LeoNerd" Evans
b515f844ee
Avoid so much copypasta between 3PU and 3PL query by unifying around a ThirdPartyEntityKind enumeration
vor 7 Jahren
Paul "LeoNerd" Evans
2a91799fcc
Minor syntax neatenings
vor 7 Jahren
Paul "LeoNerd" Evans
06964c4a0a
Copypasta the 3PU support code to also do 3PL
vor 7 Jahren
Paul "LeoNerd" Evans
718ffcf8bb
Since empty lookups now return 200/empty list not 404, we can safely log failures as exceptions
vor 7 Jahren
Paul "LeoNerd" Evans
b3511adb92
Don't catch the return-value-as-exception that @defer.inlineCallbacks will use
vor 7 Jahren
Paul "LeoNerd" Evans
3ec10dffd6
Actually make 3PU lookup calls out to ASes
vor 7 Jahren
Paul "LeoNerd" Evans
fa87c981e1
Thread 3PU lookup through as far as the AS API object; which currently noöps it
vor 7 Jahren
Mark Haines
7e2f971c08
Remove some unused functions ( #711 )
* Remove some unused functions
* get_room_events_stream is only used in tests
* is_exclusive_room might actually be something we want
vor 8 Jahren