forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep0297.ts
44 lines (38 loc) · 1.29 KB
/
xep0297.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ====================================================================
// XEP-0297: Stanza Forwarding
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0297.html
// Version: 1.0 (2013-10-02)
// ====================================================================
import { addAlias, DefinitionOptions } from '../jxt';
import { StreamType } from '../Constants';
import { NS_DELAY, NS_FORWARD_0 } from '../Namespaces';
import { Delay, IQ, Message, Presence } from './';
declare module './' {
export interface Message {
forward?: Forward;
}
}
export interface Forward {
delay?: Delay;
message?: Message;
presence?: Presence;
iq?: IQ;
}
const Protocol: DefinitionOptions[] = [
...Object.values(StreamType).map(streamNS =>
addAlias(streamNS, 'message', ['forward.message'])
),
...Object.values(StreamType).map(streamNS =>
addAlias(streamNS, 'presence', ['forward.presence'])
),
...Object.values(StreamType).map(streamNS => addAlias(streamNS, 'iq', ['forward.iq'])),
addAlias(NS_DELAY, 'delay', ['forward.delay']),
{
aliases: ['message.forward'],
element: 'forwarded',
namespace: NS_FORWARD_0,
path: 'forward'
}
];
export default Protocol;