Akihiko Odaki 19b9cb105d Introduce account document to user document
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.
2018-03-26 14:07:16 +09:00

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
});
});
}
}