@ethora/chat-component 26.7.9 → 26.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatProfileModal-D4B6nVkl.js → ChatProfileModal-DJcii-VO.js} +3 -3
- package/dist/{FilePreviewModal-DxXBzYVJ.js → FilePreviewModal-CZtgkIHl.js} +37 -37
- package/dist/{ManageDataModal-P_5uJrLo.js → ManageDataModal-aOWxvxSs.js} +2 -2
- package/dist/{MarkdownBody-DJuU5j5G.js → MarkdownBody-neDkIgJl.js} +1 -1
- package/dist/{SideDrawer-CT108Ag1.js → SideDrawer-mSCnYOgy.js} +11 -11
- package/dist/UserProfileModal-a_O8hh1O.js +594 -0
- package/dist/{UserSettingsModal-CjkqSAhD.js → UserSettingsModal-92nP1add.js} +2 -2
- package/dist/{VideoCallOverlay-D2u_n0s-.js → VideoCallOverlay-DYd3pFuD.js} +1 -1
- package/dist/{VisibilityModal-BsbvHoF6.js → VisibilityModal-BKI5XKir.js} +2 -2
- package/dist/assets/icons.d.ts +8 -0
- package/dist/components/MainComponents/AttachmentList.d.ts +5 -0
- package/dist/components/styled/MessageImage.d.ts +10 -0
- package/dist/e2ee/crypto.d.ts +32 -0
- package/dist/e2ee/index.d.ts +53 -0
- package/dist/e2ee/omemo.d.ts +130 -0
- package/dist/e2ee/protobuf.d.ts +25 -0
- package/dist/e2ee/ratchet.d.ts +54 -0
- package/dist/e2ee/stanza.d.ts +24 -0
- package/dist/e2ee/store.d.ts +12 -0
- package/dist/{handleCopyClick-CdTri-Fg.js → handleCopyClick-tizCFAb8.js} +1 -1
- package/dist/helpers/findMessagesForFile.d.ts +25 -0
- package/dist/helpers/xmppIdShape.d.ts +9 -0
- package/dist/helpers/xmppUsername.d.ts +1 -1
- package/dist/hooks/useChatWrapperInit.d.ts +5 -1
- package/dist/{main-BNdWGLpK.js → main-DkokKp7d.js} +19736 -16252
- package/dist/main.d.ts +2 -0
- package/dist/main.js +23 -20
- package/dist/networking/api-requests/rooms.api.d.ts +6 -4
- package/dist/networking/authRefresh.d.ts +6 -0
- package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +1 -1
- package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +1 -1
- package/dist/networking/xmppClient.d.ts +39 -0
- package/dist/roomStore/storage.d.ts +2 -1
- package/dist/types/models/config.model.d.ts +14 -0
- package/dist/types/models/message.model.d.ts +10 -0
- package/dist/types/models/room.model.d.ts +10 -0
- package/package.json +4 -1
- package/dist/UserProfileModal-BTmSeeuM.js +0 -574
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Client } from '@xmpp/client';
|
|
2
|
+
import { Omemo } from './omemo';
|
|
3
|
+
export { NS_OMEMO, FALLBACK_BODY, formatFingerprint } from './omemo';
|
|
4
|
+
export type { Decrypted, DeviceInfo, Trust } from './omemo';
|
|
5
|
+
export { Omemo } from './omemo';
|
|
6
|
+
/**
|
|
7
|
+
* Set from IConfig when the chat mounts.
|
|
8
|
+
*
|
|
9
|
+
* The config effect and the XMPP `online` event race, and either order is
|
|
10
|
+
* normal, so both this and onOnline() end in the same maybeStart().
|
|
11
|
+
*/
|
|
12
|
+
export declare function setE2eeEnabled(value: boolean): void;
|
|
13
|
+
export declare function isE2eeEnabled(): boolean;
|
|
14
|
+
/** Called once the XMPP session is up. */
|
|
15
|
+
export declare function onOnline(client: Client): void;
|
|
16
|
+
/** Drops the in-memory instance. Stored keys survive, so a re-login resumes. */
|
|
17
|
+
export declare function stopOmemo(): void;
|
|
18
|
+
/** The live instance, or undefined when encryption is off / not ready. */
|
|
19
|
+
export declare function omemo(): Omemo | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The instance once it is usable, rather than whatever exists right now.
|
|
22
|
+
*
|
|
23
|
+
* Publishing this device's bundle takes a round trip, and the server starts
|
|
24
|
+
* pushing archived messages the moment we join a room - so the first page of
|
|
25
|
+
* history routinely arrives while OMEMO is still starting. Reading `omemo()`
|
|
26
|
+
* there returns undefined and those messages get permanently rendered as
|
|
27
|
+
* undecryptable, even though the keys to read them land a moment later.
|
|
28
|
+
* Awaiting this instead makes the seam wait out that window.
|
|
29
|
+
*/
|
|
30
|
+
export declare function omemoReady(): Promise<Omemo | undefined>;
|
|
31
|
+
/** True when the backend marked this room as end-to-end encrypted. */
|
|
32
|
+
export declare function isE2eeRoom(roomJid: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Bare JIDs to encrypt for: every member of the room.
|
|
35
|
+
*
|
|
36
|
+
* The member list comes from `GET /v1/chats/my` (RoomMember.xmppUsername), so
|
|
37
|
+
* it is the backend's view of who belongs to the room, not the list of who
|
|
38
|
+
* happens to be joined right now. That is what we want - somebody offline
|
|
39
|
+
* still has to be able to read the message later.
|
|
40
|
+
*/
|
|
41
|
+
export declare function roomRecipients(roomJid: string, domain: string): string[];
|
|
42
|
+
/**
|
|
43
|
+
* The real bare JID behind a MUC `from`.
|
|
44
|
+
*
|
|
45
|
+
* `room@conference.host/nick` -> `nick@host`. This works because the SDK
|
|
46
|
+
* always joins with `client.jid.getLocal()` as the nick (presenceInRoom and
|
|
47
|
+
* createRoomPresence), so the nick IS the account's localpart. It is also why
|
|
48
|
+
* OMEMO works here without making rooms non-anonymous: we never need the MUC
|
|
49
|
+
* to disclose real JIDs.
|
|
50
|
+
*/
|
|
51
|
+
export declare function senderJidFromMuc(from: string | undefined, domain: string): string | undefined;
|
|
52
|
+
/** Account domain taken from our own JID, e.g. "dappros.com". */
|
|
53
|
+
export declare function accountDomain(client: Client | undefined): string;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Client } from '@xmpp/client';
|
|
2
|
+
import { Element } from 'ltx';
|
|
3
|
+
import { OmemoStore } from './store';
|
|
4
|
+
export declare const NS_OMEMO = "urn:xmpp:omemo:2";
|
|
5
|
+
/**
|
|
6
|
+
* The cleartext <body> of an encrypted stanza.
|
|
7
|
+
*
|
|
8
|
+
* Two audiences, one string, and it cannot be localised for either: it is
|
|
9
|
+
* written once by the sender, who does not know the reader's language.
|
|
10
|
+
*
|
|
11
|
+
* - clients that cannot read `urn:xmpp:omemo:2` render it in place of the
|
|
12
|
+
* message;
|
|
13
|
+
* - the server's push module copies it into `msgText`, so it is what lands on
|
|
14
|
+
* a lock screen. That rules out anything phrased as an error - keep it to a
|
|
15
|
+
* short, neutral label.
|
|
16
|
+
*/
|
|
17
|
+
export declare const FALLBACK_BODY = "Encrypted message";
|
|
18
|
+
/** Blind Trust Before Verification: new devices are trusted until one is verified. */
|
|
19
|
+
export type Trust = 'blind' | 'verified' | 'untrusted';
|
|
20
|
+
export interface Decrypted {
|
|
21
|
+
/**
|
|
22
|
+
* Content of the SCE envelope: the original <body>, <data> and whatever
|
|
23
|
+
* else the sender put there, serialized back to XML. Undefined for empty
|
|
24
|
+
* messages, which exist only to advance a session.
|
|
25
|
+
*/
|
|
26
|
+
content?: string;
|
|
27
|
+
/** 'own' - sent from this device, read back from the local cache. */
|
|
28
|
+
trust: Trust | 'own';
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface DeviceInfo {
|
|
32
|
+
id: number;
|
|
33
|
+
fingerprint: string;
|
|
34
|
+
trust: Trust | 'own';
|
|
35
|
+
}
|
|
36
|
+
/** Identity key fingerprint as shown to users: hex in groups of 8. */
|
|
37
|
+
export declare function formatFingerprint(ik: Uint8Array): string;
|
|
38
|
+
/** OMEMO 2 for one account on this device, across the MUC rooms it is in. */
|
|
39
|
+
export declare class Omemo {
|
|
40
|
+
/** Our own bare JID. */
|
|
41
|
+
readonly jid: string;
|
|
42
|
+
private readonly xmpp;
|
|
43
|
+
private readonly store;
|
|
44
|
+
private keys;
|
|
45
|
+
private queue;
|
|
46
|
+
private deviceLists;
|
|
47
|
+
private constructor();
|
|
48
|
+
/** Loads (or creates) this device's keys and publishes them. */
|
|
49
|
+
static create(xmpp: Client, jid: string, store: OmemoStore): Promise<Omemo>;
|
|
50
|
+
get deviceId(): number;
|
|
51
|
+
get fingerprint(): string;
|
|
52
|
+
/** Runs tasks one at a time: sessions and keys are read-modify-write. */
|
|
53
|
+
private serial;
|
|
54
|
+
/**
|
|
55
|
+
* Publishes, and repairs the node if its configuration blocks us.
|
|
56
|
+
*
|
|
57
|
+
* Without this, one server-side change to the PEP node configuration locks
|
|
58
|
+
* every existing account out of publishing its keys for good: the device
|
|
59
|
+
* can never announce itself, so nobody can encrypt to it and everything it
|
|
60
|
+
* sends silently degrades to plaintext. Reconfiguring is tried first
|
|
61
|
+
* because it keeps the published items; deleting the node is the last
|
|
62
|
+
* resort, and costs only bundles that every device republishes on its next
|
|
63
|
+
* login anyway.
|
|
64
|
+
*/
|
|
65
|
+
private publishWithRecovery;
|
|
66
|
+
/** Rewrites an existing node's configuration to what we publish against. */
|
|
67
|
+
private configureNode;
|
|
68
|
+
private deleteNode;
|
|
69
|
+
private publish;
|
|
70
|
+
private fetchItems;
|
|
71
|
+
private fetchDeviceList;
|
|
72
|
+
private deviceIds;
|
|
73
|
+
/** Adds this device to our published device list. */
|
|
74
|
+
private announceDevice;
|
|
75
|
+
private publishBundle;
|
|
76
|
+
private fetchBundle;
|
|
77
|
+
/** Records the device's identity key on first sight and returns its trust. */
|
|
78
|
+
private trustOf;
|
|
79
|
+
/** Devices of `jid` (fetching unknown bundles), including this one for our own JID. */
|
|
80
|
+
devices(jid: string): Promise<DeviceInfo[]>;
|
|
81
|
+
setTrust(jid: string, id: number, trust: Trust): Promise<void>;
|
|
82
|
+
/** Encrypts `keyMaterial` for every trusted device of `jid` (except this one). */
|
|
83
|
+
private encryptKey;
|
|
84
|
+
/**
|
|
85
|
+
* Builds the encrypted groupchat stanza for `roomJid`.
|
|
86
|
+
*
|
|
87
|
+
* The plaintext stanza's children are split in two:
|
|
88
|
+
*
|
|
89
|
+
* - `content` goes inside the SCE envelope and is what OMEMO protects.
|
|
90
|
+
* Today that is <body> alone.
|
|
91
|
+
* - `cleartext` is appended to the stanza untouched, beside <encrypted>.
|
|
92
|
+
* That is Ethora's <data> element, which the server's push module reads
|
|
93
|
+
* directly off the wire (get_data_map in mod_offline_post takes the
|
|
94
|
+
* first <data> sub-element); encrypting it turns every notification into
|
|
95
|
+
* a bare JID localpart plus FALLBACK_BODY.
|
|
96
|
+
*
|
|
97
|
+
* Nothing in `cleartext` is protected in any way - it is archived in MAM
|
|
98
|
+
* and POSTed to the push service exactly as an unencrypted room's would
|
|
99
|
+
* be. Keep it to what the server genuinely has to read, and never move a
|
|
100
|
+
* message's text into it.
|
|
101
|
+
*
|
|
102
|
+
* `members` are the bare JIDs of everyone in the room - ours is added
|
|
103
|
+
* automatically so our other devices can read it too. `id` must be the id
|
|
104
|
+
* the plaintext stanza would have used, because the optimistic UI matches
|
|
105
|
+
* the room's echo by it.
|
|
106
|
+
*/
|
|
107
|
+
encryptGroupMessage(roomJid: string, members: string[], content: Element[], id: string, cleartext?: Element[]): Promise<Element>;
|
|
108
|
+
/**
|
|
109
|
+
* Empty OMEMO message: completes a session the peer started. It targets one
|
|
110
|
+
* device, so it goes straight to that member's real JID rather than through
|
|
111
|
+
* the room.
|
|
112
|
+
*/
|
|
113
|
+
private sendEmpty;
|
|
114
|
+
/**
|
|
115
|
+
* Decrypts one OMEMO stanza. `sender` is the real bare JID of the author
|
|
116
|
+
* (resolved from the room nick by the caller) and `roomJid` the room it
|
|
117
|
+
* arrived in. Returns undefined when the stanza carries no OMEMO payload.
|
|
118
|
+
*/
|
|
119
|
+
decrypt(el: Element, sender: string, roomJid: string): Promise<Decrypted> | undefined;
|
|
120
|
+
private decryptUncached;
|
|
121
|
+
/**
|
|
122
|
+
* Checks the SCE envelope (XEP-0420) and returns its content as XML.
|
|
123
|
+
*
|
|
124
|
+
* The from/to check is what stops one member replaying another's encrypted
|
|
125
|
+
* message under their own nick: `from` must be the JID the room nick
|
|
126
|
+
* resolves to, and `to` must be the room the stanza arrived in.
|
|
127
|
+
*/
|
|
128
|
+
private openEnvelope;
|
|
129
|
+
private replacePrekey;
|
|
130
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface OmemoMessage {
|
|
2
|
+
n: number;
|
|
3
|
+
pn: number;
|
|
4
|
+
dhPub: Uint8Array;
|
|
5
|
+
ciphertext?: Uint8Array;
|
|
6
|
+
}
|
|
7
|
+
export declare function encodeMessage(m: OmemoMessage): Uint8Array;
|
|
8
|
+
export declare function decodeMessage(buf: Uint8Array): OmemoMessage;
|
|
9
|
+
export interface AuthenticatedMessage {
|
|
10
|
+
mac: Uint8Array;
|
|
11
|
+
/** Encoded OMEMOMessage. */
|
|
12
|
+
message: Uint8Array;
|
|
13
|
+
}
|
|
14
|
+
export declare function encodeAuthenticated(m: AuthenticatedMessage): Uint8Array;
|
|
15
|
+
export declare function decodeAuthenticated(buf: Uint8Array): AuthenticatedMessage;
|
|
16
|
+
export interface KeyExchange {
|
|
17
|
+
pkId: number;
|
|
18
|
+
spkId: number;
|
|
19
|
+
ik: Uint8Array;
|
|
20
|
+
ek: Uint8Array;
|
|
21
|
+
/** Encoded OMEMOAuthenticatedMessage. */
|
|
22
|
+
message: Uint8Array;
|
|
23
|
+
}
|
|
24
|
+
export declare function encodeKeyExchange(m: KeyExchange): Uint8Array;
|
|
25
|
+
export declare function decodeKeyExchange(buf: Uint8Array): KeyExchange;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IdentityKey, KeyPair } from './crypto';
|
|
2
|
+
export interface Bundle {
|
|
3
|
+
ik: Uint8Array;
|
|
4
|
+
spkId: number;
|
|
5
|
+
spk: Uint8Array;
|
|
6
|
+
spkSignature: Uint8Array;
|
|
7
|
+
pkId: number;
|
|
8
|
+
pk: Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
export interface Session {
|
|
11
|
+
rk: Uint8Array;
|
|
12
|
+
dhs: KeyPair;
|
|
13
|
+
dhr?: Uint8Array;
|
|
14
|
+
cks?: Uint8Array;
|
|
15
|
+
ckr?: Uint8Array;
|
|
16
|
+
ns: number;
|
|
17
|
+
nr: number;
|
|
18
|
+
pn: number;
|
|
19
|
+
/** Message keys of skipped messages, by `${dhPub}:${n}`, oldest first. */
|
|
20
|
+
skipped: Record<string, Uint8Array>;
|
|
21
|
+
/** X3DH associated data: initiator IK || responder IK. */
|
|
22
|
+
ad: Uint8Array;
|
|
23
|
+
/** The peer device's Ed25519 identity key. */
|
|
24
|
+
peerIk: Uint8Array;
|
|
25
|
+
/** We initiated and got no reply yet: wrap outgoing messages in a key exchange. */
|
|
26
|
+
pendingKex?: {
|
|
27
|
+
pkId: number;
|
|
28
|
+
spkId: number;
|
|
29
|
+
ek: Uint8Array;
|
|
30
|
+
};
|
|
31
|
+
/** Ephemeral key of the key exchange that created this session (responder side). */
|
|
32
|
+
kexEk?: Uint8Array;
|
|
33
|
+
}
|
|
34
|
+
/** Starts a session with a device from its published bundle (X3DH, active side). */
|
|
35
|
+
export declare function initiateSession(own: IdentityKey, bundle: Bundle): Session;
|
|
36
|
+
/** Builds the session from a received key exchange (X3DH, passive side). */
|
|
37
|
+
export declare function acceptSession(own: IdentityKey, spk: KeyPair, pk: KeyPair, peerIk: Uint8Array, ek: Uint8Array): Session;
|
|
38
|
+
/** Encrypts with the sending chain; returns an encoded OMEMOAuthenticatedMessage. */
|
|
39
|
+
export declare function ratchetEncrypt(session: Session, plaintext: Uint8Array): [Session, Uint8Array];
|
|
40
|
+
/**
|
|
41
|
+
* Decrypts an encoded OMEMOAuthenticatedMessage. The input session is left
|
|
42
|
+
* untouched; the returned one must be stored only after the whole message
|
|
43
|
+
* was processed successfully.
|
|
44
|
+
*/
|
|
45
|
+
export declare function ratchetDecrypt(session: Session, data: Uint8Array): [Session, Uint8Array];
|
|
46
|
+
/**
|
|
47
|
+
* Encrypts the SCE envelope. `keyMaterial` (key || truncated HMAC, 48 bytes)
|
|
48
|
+
* is what gets encrypted for every recipient device.
|
|
49
|
+
*/
|
|
50
|
+
export declare function encryptPayload(plaintext: Uint8Array): {
|
|
51
|
+
keyMaterial: Uint8Array;
|
|
52
|
+
payload: Uint8Array;
|
|
53
|
+
};
|
|
54
|
+
export declare function decryptPayload(keyMaterial: Uint8Array, payload: Uint8Array): Uint8Array;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Element } from 'ltx';
|
|
2
|
+
export type DecryptOutcome =
|
|
3
|
+
/** No OMEMO payload; the caller should carry on as before. */
|
|
4
|
+
'not-encrypted'
|
|
5
|
+
/** Rewritten with the sender's original children. */
|
|
6
|
+
| 'decrypted'
|
|
7
|
+
/** Rewritten with a placeholder body; still a message worth showing. */
|
|
8
|
+
| 'undecryptable'
|
|
9
|
+
/** Session maintenance only - there is nothing to render, skip it. */
|
|
10
|
+
| 'drop';
|
|
11
|
+
/**
|
|
12
|
+
* Finds the <message> that actually carries <encrypted>, looking through the
|
|
13
|
+
* wrappers a message can arrive in: a mucsub event, a MAM <result>/<forwarded>
|
|
14
|
+
* pair, or both at once.
|
|
15
|
+
*/
|
|
16
|
+
export declare function encryptedCarrier(stanza: Element, depth?: number): Element | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Decrypts `stanza` in place, if it carries OMEMO at all.
|
|
19
|
+
*
|
|
20
|
+
* `stanza` may be the message itself or anything wrapping it. Safe to call on
|
|
21
|
+
* every message: without an OMEMO payload it returns immediately and touches
|
|
22
|
+
* nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function decryptStanzaInPlace(stanza: Element, domain: string): Promise<DecryptOutcome>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Key-value storage for OMEMO keys, sessions and decrypted messages. */
|
|
2
|
+
export interface OmemoStore {
|
|
3
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
4
|
+
set(key: string, value: unknown): Promise<void>;
|
|
5
|
+
delete(key: string): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* IndexedDB database per account. Private keys are stored unencrypted, like
|
|
9
|
+
* in other web clients: anyone with access to this browser profile can read them.
|
|
10
|
+
*/
|
|
11
|
+
export declare function openIndexedDbStore(jid: string): Promise<OmemoStore>;
|
|
12
|
+
export declare function createMemoryStore(): OmemoStore;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IRoom } from '../types/types';
|
|
2
|
+
export interface FileMessageMatch {
|
|
3
|
+
roomJID: string;
|
|
4
|
+
messageId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DeletableFileRef {
|
|
7
|
+
_id: string;
|
|
8
|
+
roomName?: string;
|
|
9
|
+
location?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Finds every locally loaded message that carries the given file, so
|
|
13
|
+
* deleting a file from the Files panel can also tombstone its chat
|
|
14
|
+
* message(s) instead of leaving a broken-image bubble behind.
|
|
15
|
+
*
|
|
16
|
+
* `file.roomName` is checked first: sent-media messages stamp `attachmentId`
|
|
17
|
+
* on the message (see useSendMessage.tsx / sendMediaMessage.xmpp.ts) with
|
|
18
|
+
* the same id the backend gives the file, and the Files API's `roomName`
|
|
19
|
+
* field actually holds the room's JID (see FilesList.tsx / bug 3), so most
|
|
20
|
+
* of the time the right room is known outright. When that doesn't resolve
|
|
21
|
+
* anything - a different backend shape, or the id genuinely isn't on the
|
|
22
|
+
* message - every locally loaded room is searched by attachment location as
|
|
23
|
+
* a fallback, since a matching URL is still a correct match.
|
|
24
|
+
*/
|
|
25
|
+
export declare const findMessagesForFile: (rooms: Record<string, IRoom>, file: DeletableFileRef) => FileMessageMatch[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const toLocalPart: (value?: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* True when `value` (a full JID or already-bare local part) is a
|
|
4
|
+
* machine-generated Ethora id rather than anything a human would recognize
|
|
5
|
+
* as their own name - `<24 hex>_<24 hex>` (appId_userId) or a bare 24-hex
|
|
6
|
+
* id. Kept narrow on purpose: a handle a person actually picked is never
|
|
7
|
+
* this shape, so it is never mistaken for one.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isOpaqueXmppUserId: (value: string | undefined | null) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { toLocalPart, isOpaqueXmppUserId } from './xmppIdShape';
|
|
2
2
|
export declare const normalizeXmppUsername: (value: string | undefined | null) => string;
|
|
3
3
|
export declare const isSameXmppUsername: (a: string | undefined | null, b: string | undefined | null) => boolean;
|
|
@@ -17,6 +17,10 @@ interface useChatWrapperInitResult {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const resolveLegacyTranslatesLangSource: (translatesConfig?: IConfig["translates"]) => Iso639_1Codes | undefined;
|
|
19
19
|
export declare const resolveExternalReaderLocaleLangSource: (readerLocale?: string) => Iso639_1Codes | undefined;
|
|
20
|
-
export declare const isStatusConnectionLost: (status?: string | null) => boolean;
|
|
20
|
+
export declare const isStatusConnectionLost: (status?: string | null, isRecoveringAuth?: boolean, hasEverBeenOnline?: boolean) => boolean;
|
|
21
|
+
export declare const hasHostRefreshedSession: (user: {
|
|
22
|
+
xmppUsername?: string;
|
|
23
|
+
xmppPassword?: string;
|
|
24
|
+
}) => boolean;
|
|
21
25
|
declare const useChatWrapperInit: ({ roomJID, wasAutoSelected, config, }: useChatWrapperInitProps) => useChatWrapperInitResult;
|
|
22
26
|
export default useChatWrapperInit;
|