An account document is attached to a user document if an account of the user is on the server. It may be missing if the user is on a remote server.
21 lines
360 B
TypeScript
21 lines
360 B
TypeScript
import Stream from './stream';
|
|
import MiOS from '../../mios';
|
|
|
|
/**
|
|
* Messaging stream connection
|
|
*/
|
|
export class MessagingStream extends Stream {
|
|
constructor(os: MiOS, me, otherparty) {
|
|
super(os, 'messaging', {
|
|
i: me.account.token,
|
|
otherparty
|
|
});
|
|
|
|
(this as any).on('_connected_', () => {
|
|
this.send({
|
|
i: me.account.token
|
|
});
|
|
});
|
|
}
|
|
}
|