Skip to content

Commit

Permalink
Add missing parameter in AppServiceAPI.request
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Apr 16, 2021
1 parent 5cce6fd commit f289195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions mautrix/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ async def request(self, method: Method, path: Union[PathBuilder, str],
If the headers don't contain ``Content-Type``, it'll be set to ``application/json``.
The ``Authorization`` header is always overridden if :attr:`token` is set.
query_params: A dict of query parameters to send.
retry_count: Number of times to retry if the homeserver isn't reachable.
Returns:
The parsed response JSON.
Expand Down
6 changes: 4 additions & 2 deletions mautrix/appservice/api/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def intent(self, user: UserID = None, token: Optional[str] = None,
def request(self, method: Method, path: PathBuilder,
content: Optional[Union[Dict, bytes, str]] = None, timestamp: Optional[int] = None,
headers: Optional[Dict[str, str]] = None,
query_params: Optional[Dict[str, Any]] = None) -> Awaitable[Dict]:
query_params: Optional[Dict[str, Any]] = None,
retry_count: Optional[int] = None) -> Awaitable[Dict]:
"""
Make a raw HTTP request, with optional AppService timestamp massaging and external_url
setting.
Expand All @@ -182,6 +183,7 @@ def request(self, method: Method, path: PathBuilder,
timestamp: The timestamp query param used for timestamp massaging.
headers: The dict of HTTP headers to send.
query_params: The dict of query parameters to send.
retry_count: Number of times to retry if the homeserver isn't reachable.
Returns:
The response as a dict.
Expand All @@ -194,7 +196,7 @@ def request(self, method: Method, path: PathBuilder,
if not self.is_real_user:
query_params["user_id"] = self.identity or self.bot_mxid

return super().request(method, path, content, headers, query_params)
return super().request(method, path, content, headers, query_params, retry_count)


class ChildAppServiceAPI(AppServiceAPI):
Expand Down

0 comments on commit f289195

Please sign in to comment.