Update some comments
- TalkAPIClient#close is the "logout" command that was wanted - Direct Chats do share the same ID for every member
This commit is contained in:
parent
c691372c6a
commit
652aa22048
@ -1881,7 +1881,7 @@ class Portal(DBPortal, BasePortal):
|
|||||||
if not self.is_direct:
|
if not self.is_direct:
|
||||||
self._main_intent = self.az.intent
|
self._main_intent = self.az.intent
|
||||||
else:
|
else:
|
||||||
# TODO Save kt_sender in DB instead? Depends on if DM channels are shared...
|
# TODO Save kt_sender in DB instead? Only do that if keeping a unique DM portal for each receiver
|
||||||
user = await u.User.get_by_ktid(self.kt_receiver)
|
user = await u.User.get_by_ktid(self.kt_receiver)
|
||||||
assert user, f"Found no user for this portal's receiver of {self.kt_receiver}"
|
assert user, f"Found no user for this portal's receiver of {self.kt_receiver}"
|
||||||
if self.kt_type == KnownChannelType.MemoChat:
|
if self.kt_type == KnownChannelType.MemoChat:
|
||||||
@ -1920,7 +1920,7 @@ class Portal(DBPortal, BasePortal):
|
|||||||
create: bool = True,
|
create: bool = True,
|
||||||
kt_type: ChannelType | None = None,
|
kt_type: ChannelType | None = None,
|
||||||
) -> Portal | None:
|
) -> Portal | None:
|
||||||
# TODO Find out if direct channels are shared. If so, don't need kt_receiver!
|
# TODO Direct chats are shared, so can remove kt_receiver if DM portals should be shared
|
||||||
if kt_type:
|
if kt_type:
|
||||||
kt_receiver = kt_receiver if KnownChannelType.is_direct(kt_type) else 0
|
kt_receiver = kt_receiver if KnownChannelType.is_direct(kt_type) else 0
|
||||||
ktid_full = (ktid, kt_receiver)
|
ktid_full = (ktid, kt_receiver)
|
||||||
|
@ -434,7 +434,6 @@ class User(DBUser, BaseUser):
|
|||||||
|
|
||||||
async def logout(self, *, remove_ktid: bool = True, reset_device: bool = False) -> None:
|
async def logout(self, *, remove_ktid: bool = True, reset_device: bool = False) -> None:
|
||||||
if self._client:
|
if self._client:
|
||||||
# TODO Look for a logout API call
|
|
||||||
await self._client.stop()
|
await self._client.stop()
|
||||||
if remove_ktid:
|
if remove_ktid:
|
||||||
await self.push_bridge_state(BridgeStateEvent.LOGGED_OUT)
|
await self.push_bridge_state(BridgeStateEvent.LOGGED_OUT)
|
||||||
|
@ -527,7 +527,6 @@ export default class PeerClient {
|
|||||||
* request failed, its status is stored here.
|
* request failed, its status is stored here.
|
||||||
*/
|
*/
|
||||||
handleLogin = async (req) => {
|
handleLogin = async (req) => {
|
||||||
// TODO Look for a logout API call
|
|
||||||
const authClient = await this.#createAuthClient(req.uuid)
|
const authClient = await this.#createAuthClient(req.uuid)
|
||||||
const loginRes = await authClient.login(req.form, req.forced)
|
const loginRes = await authClient.login(req.form, req.forced)
|
||||||
if (loginRes.status === KnownAuthStatusCode.DEVICE_NOT_REGISTERED) {
|
if (loginRes.status === KnownAuthStatusCode.DEVICE_NOT_REGISTERED) {
|
||||||
|
Loading…
Reference in New Issue
Block a user