Mercurial > libervia-web
annotate libervia/web/server/restricted_bridge.py @ 1644:8a09eea9003f default tip
doc (user): Add doc for forum feature:
fix 463
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 06 Sep 2025 17:28:07 +0200 |
parents | c03297bb8d19 |
children |
rev | line source |
---|---|
1287 | 1 #!/usr/bin/env python3 |
2 | |
1595
7941444c1671
pages: set `own_local_jid` to avoid confusion with `own_jid`:
Goffi <goffi@goffi.org>
parents:
1593
diff
changeset
|
3 # Libervia Web Frontend |
1396 | 4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) |
1287 | 5 |
6 # This program is free software: you can redistribute it and/or modify | |
7 # it under the terms of the GNU Affero General Public License as published by | |
8 # the Free Software Foundation, either version 3 of the License, or | |
9 # (at your option) any later version. | |
10 | |
11 # This program is distributed in the hope that it will be useful, | |
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 # GNU Affero General Public License for more details. | |
15 | |
16 # You should have received a copy of the GNU Affero General Public License | |
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | |
1600
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
19 from libervia.backend.core import exceptions |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
20 from libervia.backend.core.log import getLogger |
1518
eb00d593801d
refactoring: rename `libervia` to `libervia.web` + update imports following backend changes
Goffi <goffi@goffi.org>
parents:
1516
diff
changeset
|
21 from libervia.backend.tools.common import data_format |
1600
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
22 |
1518
eb00d593801d
refactoring: rename `libervia` to `libervia.web` + update imports following backend changes
Goffi <goffi@goffi.org>
parents:
1516
diff
changeset
|
23 from libervia.web.server.constants import Const as C |
1287 | 24 |
25 | |
1600
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
26 log = getLogger(__name__) |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
27 |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
28 |
1287 | 29 class RestrictedBridge: |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
30 """bridge with limited access, which can be used in browser |
1287 | 31 |
32 Only a few method are implemented, with potentially dangerous argument controlled. | |
33 Security limit is used | |
34 """ | |
35 | |
36 def __init__(self, host): | |
37 self.host = host | |
38 self.security_limit = C.SECURITY_LIMIT | |
39 | |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
40 def no_service_profile(self, profile): |
1480
e739600267cd
server (restricted_bridge): don't allow bridge methods modifying anything with service profile
Goffi <goffi@goffi.org>
parents:
1414
diff
changeset
|
41 """Raise an error if service profile is used""" |
e739600267cd
server (restricted_bridge): don't allow bridge methods modifying anything with service profile
Goffi <goffi@goffi.org>
parents:
1414
diff
changeset
|
42 if profile == C.SERVICE_PROFILE: |
e739600267cd
server (restricted_bridge): don't allow bridge methods modifying anything with service profile
Goffi <goffi@goffi.org>
parents:
1414
diff
changeset
|
43 raise exceptions.PermissionError( |
e739600267cd
server (restricted_bridge): don't allow bridge methods modifying anything with service profile
Goffi <goffi@goffi.org>
parents:
1414
diff
changeset
|
44 "This action is not allowed for service profile" |
e739600267cd
server (restricted_bridge): don't allow bridge methods modifying anything with service profile
Goffi <goffi@goffi.org>
parents:
1414
diff
changeset
|
45 ) |
e739600267cd
server (restricted_bridge): don't allow bridge methods modifying anything with service profile
Goffi <goffi@goffi.org>
parents:
1414
diff
changeset
|
46 |
1516
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
47 async def action_launch( |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
48 self, callback_id: str, data_s: str, profile: str |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
49 ) -> str: |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
50 self.no_service_profile(profile) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
51 return await self.host.bridge_call( |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
52 "action_launch", callback_id, data_s, profile |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
53 ) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
54 |
1593
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
55 async def bookmarks_list( |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
56 self, |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
57 type_: str, |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
58 storage_location: str, |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
59 profile: str |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
60 ): |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
61 self.no_service_profile(profile) |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
62 return await self.host.bridge_call( |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
63 "bookmarks_list", type_, storage_location, profile |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
64 ) |
c6976c5b85a1
browser (chat/select): add bookmarked entities on empty search
Goffi <goffi@goffi.org>
parents:
1585
diff
changeset
|
65 |
1516
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
66 async def call_start(self, entity: str, call_data_s: str, profile: str) -> None: |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
67 self.no_service_profile(profile) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
68 return await self.host.bridge_call( |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
69 "call_start", entity, call_data_s, profile |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
70 ) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
71 |
1549
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
72 async def call_answer_sdp( |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
73 self, session_id: str, answer_sdp: str, profile: str |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
74 ) -> None: |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
75 self.no_service_profile(profile) |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
76 return await self.host.bridge_call( |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
77 "call_answer_sdp", session_id, answer_sdp, profile |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
78 ) |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
79 |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
80 async def call_info( |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
81 self, session_id: str, info_type: str, extra_s: str, profile: str |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
82 ) -> None: |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
83 self.no_service_profile(profile) |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
84 return await self.host.bridge_call( |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
85 "call_info", session_id, info_type, extra_s, profile |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
86 ) |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
87 |
1516
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
88 async def call_end(self, session_id: str, call_data: str, profile: str) -> None: |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
89 self.no_service_profile(profile) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
90 return await self.host.bridge_call( |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
91 "call_end", session_id, call_data, profile |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
92 ) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
93 |
1604
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
94 async def call_group_data_set( |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
95 self, |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
96 room_jid_s: str, |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
97 call_data_s: str, |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
98 profile: str |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
99 ) -> str: |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
100 self.no_service_profile(profile) |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
101 return await self.host.bridge_call( |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
102 "call_group_data_set", room_jid_s, call_data_s, profile |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
103 ) |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
104 |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
105 async def call_group_start( |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
106 self, |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
107 entities: list[str], |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
108 extra_s: str, |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
109 profile: str |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
110 ) -> str: |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
111 self.no_service_profile(profile) |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
112 return await self.host.bridge_call( |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
113 "call_group_start", entities, extra_s, profile |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
114 ) |
4a9679369856
browser (call): implements group calls:
Goffi <goffi@goffi.org>
parents:
1602
diff
changeset
|
115 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
116 async def contacts_get(self, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
117 return await self.host.bridge_call("contacts_get", profile) |
1329
ed28ad7d484c
browser (cache): new `cache` module to handle cache of roster and identities:
Goffi <goffi@goffi.org>
parents:
1315
diff
changeset
|
118 |
1516
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
119 async def external_disco_get(self, entity, profile): |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
120 self.no_service_profile(profile) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
121 return await self.host.bridge_call( |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
122 "external_disco_get", entity, profile) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
123 |
1600
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
124 async def file_jingle_send( |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
125 self, |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
126 peer_jid: str, |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
127 filepath: str, |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
128 name: str, |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
129 file_desc: str, |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
130 extra_s: str, |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
131 profile: str |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
132 ) -> str: |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
133 self.no_service_profile(profile) |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
134 if filepath: |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
135 # The file sending must be done P2P from the browser directly (the file is |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
136 # from end-user machine), and its data must be set in "extra". |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
137 # "filepath" must NOT be used in this case, as it would link a local file |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
138 # (i.e. from the backend machine), which is an obvious security issue. |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
139 log.warning( |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
140 f'"filepath" user by {profile!r} in file_jingle_send, this is not ' |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
141 "allowed, hack attempt?" |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
142 ) |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
143 raise exceptions.PermissionError( |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
144 "Using a filepath is not allowed." |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
145 ) |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
146 return await self.host.bridge_call( |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
147 "file_jingle_send", peer_jid, "", name, file_desc, extra_s, profile |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
148 ) |
0a4433a343a3
browser (calls): implement WebRTC file sharing:
Goffi <goffi@goffi.org>
parents:
1595
diff
changeset
|
149 |
1581
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
150 async def history_get( |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
151 self, |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
152 from_jid: str, |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
153 to_jid: str, |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
154 limit: int, |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
155 between: bool, |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
156 filters: dict[str, str], |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
157 profile: str |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
158 ): |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
159 self.no_service_profile(profile) |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
160 return await self.host.bridge_call( |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
161 "history_get", from_jid, to_jid, limit, between, filters, profile |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
162 ) |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
163 |
1516
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
164 async def ice_candidates_add(self, session_id, media_ice_data_s, profile): |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
165 self.no_service_profile(profile) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
166 return await self.host.bridge_call( |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
167 "ice_candidates_add", session_id, media_ice_data_s, profile |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
168 ) |
a3ca1bab6eb1
server, restricted bridge: add new methods and signals to prepare calls implementation:
Goffi <goffi@goffi.org>
parents:
1509
diff
changeset
|
169 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
170 async def identity_get(self, entity, metadata_filter, use_cache, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
171 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
172 "identity_get", entity, metadata_filter, use_cache, profile) |
1329
ed28ad7d484c
browser (cache): new `cache` module to handle cache of roster and identities:
Goffi <goffi@goffi.org>
parents:
1315
diff
changeset
|
173 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
174 async def identities_get(self, entities, metadata_filter, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
175 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
176 "identities_get", entities, metadata_filter, profile) |
1329
ed28ad7d484c
browser (cache): new `cache` module to handle cache of roster and identities:
Goffi <goffi@goffi.org>
parents:
1315
diff
changeset
|
177 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
178 async def identities_base_get(self, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
179 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
180 "identities_base_get", profile) |
1329
ed28ad7d484c
browser (cache): new `cache` module to handle cache of roster and identities:
Goffi <goffi@goffi.org>
parents:
1315
diff
changeset
|
181 |
1581
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
182 async def message_edit( |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
183 self, message_id: str, edit_data_s: str, profile: str |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
184 ) -> None: |
1585
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
185 self.no_service_profile(profile) |
1581
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
186 return await self.host.bridge_call( |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
187 "message_edit", message_id, edit_data_s, profile |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
188 ) |
fe1995d0df09
server (restricted_bridge): add `history_get` and `message_edit`
Goffi <goffi@goffi.org>
parents:
1576
diff
changeset
|
189 |
1635
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
190 async def message_forward( |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
191 self, message_id: str, recipient_jid: str, profile: str |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
192 ) -> None: |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
193 self.no_service_profile(profile) |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
194 return await self.host.bridge_call( |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
195 "message_forward", message_id, recipient_jid, profile |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
196 ) |
332822ceae85
browser (chat): Add rich editor, forward and extra recipients:
Goffi <goffi@goffi.org>
parents:
1624
diff
changeset
|
197 |
1576
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
198 async def message_reactions_set( |
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
199 self, message_id: str, reactions: list[str], update_type: str, profile: str |
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
200 ) -> None: |
1585
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
201 self.no_service_profile(profile) |
1576
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
202 return await self.host.bridge_call( |
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
203 "message_reactions_set", message_id, reactions, update_type, profile |
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
204 ) |
c7d15ded4cbb
server (restricted_bridge): add `message_reactions_set` method.
Goffi <goffi@goffi.org>
parents:
1549
diff
changeset
|
205 |
1585
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
206 async def message_retract( |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
207 self, message_id: str, profile: str |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
208 ) -> None: |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
209 self.no_service_profile(profile) |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
210 return await self.host.bridge_call( |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
211 "message_retract", message_id, profile |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
212 ) |
9fc4120888be
browser (chat): message retraction implementation
Goffi <goffi@goffi.org>
parents:
1581
diff
changeset
|
213 |
1534
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
214 async def message_send( |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
215 self, to_jid_s, message, subject, mess_type, extra_s, |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
216 profile |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
217 ): |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
218 self.no_service_profile(profile) |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
219 return await self.host.bridge_call( |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
220 "message_send", to_jid_s, message, subject, mess_type, extra_s, profile |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
221 ) |
49ad8dd210d0
server (restricted_bridge): add `message_send` method
Goffi <goffi@goffi.org>
parents:
1518
diff
changeset
|
222 |
1642
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
223 async def ps_invite( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
224 self, invitee_jid_s, service_s, node, item_id, name, extra_s, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
225 ): |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
226 self.no_service_profile(profile) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
227 return await self.host.bridge_call( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
228 "ps_invite", invitee_jid_s, service_s, node, item_id, name, extra_s, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
229 ) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
230 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
231 async def ps_node_delete(self, service_s, node, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
232 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
233 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
234 "ps_node_delete", service_s, node, profile) |
1379
4c51f22a813a
server (restricted_bridge): added `psNodeDelete`, `psNodeAffiliationsSet`, `psItemRetract` and `psInvite`
Goffi <goffi@goffi.org>
parents:
1350
diff
changeset
|
235 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
236 async def ps_node_affiliations_set(self, service_s, node, affiliations, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
237 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
238 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
239 "ps_node_affiliations_set", service_s, node, affiliations, profile) |
1379
4c51f22a813a
server (restricted_bridge): added `psNodeDelete`, `psNodeAffiliationsSet`, `psItemRetract` and `psInvite`
Goffi <goffi@goffi.org>
parents:
1350
diff
changeset
|
240 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
241 async def ps_item_retract(self, service_s, node, item_id, notify, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
242 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
243 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
244 "ps_item_retract", service_s, node, item_id, notify, profile) |
1379
4c51f22a813a
server (restricted_bridge): added `psNodeDelete`, `psNodeAffiliationsSet`, `psItemRetract` and `psInvite`
Goffi <goffi@goffi.org>
parents:
1350
diff
changeset
|
245 |
1642
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
246 async def ps_attachments_get( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
247 self, service_s: str, node: str, item: str, senders_s: list[str], extra_s: str, |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
248 profile: str |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
249 ) -> None: |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
250 return await self.host.bridge_call( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
251 "ps_attachments_get", service_s, node, item, senders_s, extra_s, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
252 ) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
253 |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
254 async def ps_attachments_set( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
255 self, attachments_s: str, profile: str |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
256 ) -> None: |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
257 self.no_service_profile(profile) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
258 return await self.host.bridge_call( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
259 "ps_attachments_set", attachments_s, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
260 ) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
261 |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
262 async def ps_subscribe( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
263 self, service_s, node, options_s, profile: str |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
264 ) -> str: |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
265 self.no_service_profile(profile) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
266 return await self.host.bridge_call( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
267 "ps_subscribe", service_s, node, options_s, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
268 ) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
269 |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
270 async def ps_unsubscribe( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
271 self, service_s, node, profile: str |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
272 ) -> str: |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
273 self.no_service_profile(profile) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
274 return await self.host.bridge_call( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
275 "ps_unsubscribe", service_s, node, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
276 ) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
277 |
1639
301fe2f1a34a
Update `mb_send` calls following changes in backend.
Goffi <goffi@goffi.org>
parents:
1635
diff
changeset
|
278 async def mb_preview(self, data, profile): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
279 return await self.host.bridge_call( |
1639
301fe2f1a34a
Update `mb_send` calls following changes in backend.
Goffi <goffi@goffi.org>
parents:
1635
diff
changeset
|
280 "mb_preview", data, profile |
301fe2f1a34a
Update `mb_send` calls following changes in backend.
Goffi <goffi@goffi.org>
parents:
1635
diff
changeset
|
281 ) |
1414
97b8ce9ce54b
server (restricted_bridge): add mbPreview
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
282 |
1642
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
283 async def mb_send(self, data_s, profile): |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
284 self.no_service_profile(profile) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
285 return await self.host.bridge_call( |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
286 "mb_send", data_s, profile |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
287 ) |
c03297bb8d19
server, browser (forums): Redesign of the forum feature:
Goffi <goffi@goffi.org>
parents:
1639
diff
changeset
|
288 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
289 async def list_set(self, service_s, node, values, schema, item_id, extra, profile): |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
290 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
291 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
292 "list_set", service_s, node, values, "", item_id, "", profile) |
1391
fc20818a5266
server (restricted_bridge): add `listSet` method
Goffi <goffi@goffi.org>
parents:
1379
diff
changeset
|
293 |
fc20818a5266
server (restricted_bridge): add `listSet` method
Goffi <goffi@goffi.org>
parents:
1379
diff
changeset
|
294 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
295 async def file_http_upload_get_slot( |
1287 | 296 self, filename, size, content_type, upload_jid, profile): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
297 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
298 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
299 "file_http_upload_get_slot", filename, size, content_type, |
1287 | 300 upload_jid, profile) |
1295
0930b06f022f
server (restricted_bridge): added fileSharingDelete and interestRetract
Goffi <goffi@goffi.org>
parents:
1287
diff
changeset
|
301 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
302 async def file_sharing_delete( |
1295
0930b06f022f
server (restricted_bridge): added fileSharingDelete and interestRetract
Goffi <goffi@goffi.org>
parents:
1287
diff
changeset
|
303 self, service_jid, path, namespace, profile): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
304 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
305 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
306 "file_sharing_delete", service_jid, path, namespace, profile) |
1295
0930b06f022f
server (restricted_bridge): added fileSharingDelete and interestRetract
Goffi <goffi@goffi.org>
parents:
1287
diff
changeset
|
307 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
308 async def interests_file_sharing_register( |
1350
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
309 self, service, repos_type, namespace, path, name, extra_s, profile |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
310 ): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
311 self.no_service_profile(profile) |
1350
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
312 if extra_s: |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
313 # we only allow "thumb_url" here |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
314 extra = data_format.deserialise(extra_s) |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
315 if "thumb_url" in extra: |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
316 extra_s = data_format.serialise({"thumb_url": extra["thumb_url"]}) |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
317 else: |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
318 extra_s = "" |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
319 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
320 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
321 "interests_file_sharing_register", service, repos_type, namespace, path, name, |
1350
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
322 extra_s, profile |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
323 ) |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
324 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
325 async def interest_retract( |
1295
0930b06f022f
server (restricted_bridge): added fileSharingDelete and interestRetract
Goffi <goffi@goffi.org>
parents:
1287
diff
changeset
|
326 self, service_jid, item_id, profile |
0930b06f022f
server (restricted_bridge): added fileSharingDelete and interestRetract
Goffi <goffi@goffi.org>
parents:
1287
diff
changeset
|
327 ): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
328 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
329 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
330 "interest_retract", service_jid, item_id, profile) |
1295
0930b06f022f
server (restricted_bridge): added fileSharingDelete and interestRetract
Goffi <goffi@goffi.org>
parents:
1287
diff
changeset
|
331 |
1549
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
332 async def jingle_terminate( |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
333 self, session_id: str, reason: str, reason_txt: str, profile: str |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
334 ) -> None: |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
335 self.no_service_profile(profile) |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
336 return await self.host.bridge_call( |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
337 "jingle_terminate", session_id, reason, reason_txt, profile |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
338 ) |
e47c24204449
browser (calls): update call to handle search, control buttons, and better UI/UX:
Goffi <goffi@goffi.org>
parents:
1546
diff
changeset
|
339 |
1619 | 340 async def muc_invite( |
341 self, guest_jid_s: str, room_jid_s: str, options: dict[str, str], profile: str | |
342 ): | |
343 self.no_service_profile(profile) | |
344 return await self.host.bridge_call( | |
345 "muc_invite", guest_jid_s, room_jid_s, options, profile | |
346 ) | |
347 | |
348 async def muc_occupants_get( | |
349 self, room_jid_s: str, profile: str | |
350 ): | |
351 self.no_service_profile(profile) | |
352 return await self.host.bridge_call( | |
353 "muc_occupants_get", room_jid_s, profile | |
354 ) | |
355 | |
356 async def muc_join( | |
357 self, room_jid_s: str, nick: str, options: dict[str, str], profile: str | |
358 ): | |
359 self.no_service_profile(profile) | |
360 return await self.host.bridge_call( | |
361 "muc_join", room_jid_s, nick, options, profile | |
362 ) | |
363 | |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
364 async def fis_invite( |
1315
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
365 self, invitee_jid_s, service_s, repos_type, namespace, path, name, extra_s, |
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
366 profile |
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
367 ): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
368 self.no_service_profile(profile) |
1350
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
369 if extra_s: |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
370 # we only allow "thumb_url" here |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
371 extra = data_format.deserialise(extra_s) |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
372 if "thumb_url" in extra: |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
373 extra_s = data_format.serialise({"thumb_url": extra["thumb_url"]}) |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
374 else: |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
375 extra_s = "" |
a32f3f47e4a8
server (restricted_bridge): added `interestsRegisterFileSharing` + filter extra_s in `FISInvite`
Goffi <goffi@goffi.org>
parents:
1331
diff
changeset
|
376 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
377 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
378 "fis_invite", invitee_jid_s, service_s, repos_type, namespace, path, name, |
1315
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
379 extra_s, profile |
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
380 ) |
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
381 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
382 async def fis_affiliations_set( |
1315
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
383 self, service_s, namespace, path, affiliations, profile |
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
384 ): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
385 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
386 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
387 "fis_affiliations_set", service_s, namespace, path, affiliations, profile |
1315
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
388 ) |
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
389 |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
390 async def invitation_simple_create( |
1331
fe353fceec38
browser (invitation, photos/album): invitation manager improvments:
Goffi <goffi@goffi.org>
parents:
1329
diff
changeset
|
391 self, invitee_email, invitee_name, url_template, extra_s, profile |
fe353fceec38
browser (invitation, photos/album): invitation manager improvments:
Goffi <goffi@goffi.org>
parents:
1329
diff
changeset
|
392 ): |
1509
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
393 self.no_service_profile(profile) |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
394 return await self.host.bridge_call( |
106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
1480
diff
changeset
|
395 "invitation_simple_create", invitee_email, invitee_name, url_template, extra_s, |
1331
fe353fceec38
browser (invitation, photos/album): invitation manager improvments:
Goffi <goffi@goffi.org>
parents:
1329
diff
changeset
|
396 profile |
1315
991ff12241e0
server (restricted_bridge): added `FISInvite`, `FISAffiliationsSet` and `invitationSimpleCreate`
Goffi <goffi@goffi.org>
parents:
1295
diff
changeset
|
397 ) |
1539
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
398 |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
399 async def url_preview_get( |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
400 self, url, options_s, profile |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
401 ): |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
402 self.no_service_profile(profile) |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
403 return await self.host.bridge_call( |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
404 "url_preview_get", url, options_s, profile |
bc856e74f74d
server (restricted_bridge): add `url_preview_get`
Goffi <goffi@goffi.org>
parents:
1534
diff
changeset
|
405 ) |
1546
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
406 |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
407 async def jid_search( |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
408 self, search_term: str, options_s: str, profile: str |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
409 ) -> str: |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
410 self.no_service_profile(profile) |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
411 return await self.host.bridge_call( |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
412 "jid_search", search_term, options_s, profile |
7f3f5ae7d65a
browser (jid_search): implement a mechanism to get JIDs from search terms
Goffi <goffi@goffi.org>
parents:
1539
diff
changeset
|
413 ) |
1602
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
414 |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
415 async def remote_control_start( |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
416 self, peer_jid_s: str, extra_s: str, profile: str |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
417 ) -> None: |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
418 self.no_service_profile(profile) |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
419 return await self.host.bridge_call( |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
420 "remote_control_start", peer_jid_s, extra_s, profile |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
421 ) |
6feac4a25e60
browser: Remote Control implementation:
Goffi <goffi@goffi.org>
parents:
1600
diff
changeset
|
422 |