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:
Andrew Ferrazzutti 2022-05-10 01:15:11 -04:00
parent c691372c6a
commit 652aa22048
3 changed files with 2 additions and 4 deletions

View File

@ -1881,7 +1881,7 @@ class Portal(DBPortal, BasePortal):
if not self.is_direct:
self._main_intent = self.az.intent
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)
assert user, f"Found no user for this portal's receiver of {self.kt_receiver}"
if self.kt_type == KnownChannelType.MemoChat:
@ -1920,7 +1920,7 @@ class Portal(DBPortal, BasePortal):
create: bool = True,
kt_type: ChannelType | None = 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:
kt_receiver = kt_receiver if KnownChannelType.is_direct(kt_type) else 0
ktid_full = (ktid, kt_receiver)

View File

@ -434,7 +434,6 @@ class User(DBUser, BaseUser):
async def logout(self, *, remove_ktid: bool = True, reset_device: bool = False) -> None:
if self._client:
# TODO Look for a logout API call
await self._client.stop()
if remove_ktid:
await self.push_bridge_state(BridgeStateEvent.LOGGED_OUT)

View File

@ -527,7 +527,6 @@ export default class PeerClient {
* request failed, its status is stored here.
*/
handleLogin = async (req) => {
// TODO Look for a logout API call
const authClient = await this.#createAuthClient(req.uuid)
const loginRes = await authClient.login(req.form, req.forced)
if (loginRes.status === KnownAuthStatusCode.DEVICE_NOT_REGISTERED) {