tctoken: return error in ensureTCToken if not logged in

This commit is contained in:
Tulir Asokan
2026-06-22 21:17:28 +03:00
parent e94c58afd4
commit c50f490413
+3
View File
@@ -118,6 +118,9 @@ func (cli *Client) unlockedCleanupTCTokenSenderTSMap() {
// ensureTCToken returns a stored non-expired tctoken for the given JID, if available.
func (cli *Client) ensureTCToken(ctx context.Context, jid types.JID) (token []byte, err error) {
if cli.getOwnID().IsEmpty() {
return nil, ErrNotLoggedIn
}
cli.deleteExpiredPrivacyTokens()
storageJID := cli.resolveTCTokenStorageLID(ctx, jid)
existing, err := cli.Store.PrivacyTokens.GetPrivacyToken(ctx, storageJID)