-
Notifications
You must be signed in to change notification settings - Fork 251
/
xep0203.ts
37 lines (32 loc) · 972 Bytes
/
xep0203.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
// ====================================================================
// XEP-0203: Delayed Delivery
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0203.html
// Version: 2.0 (2009-09-15)
// ====================================================================
import { dateAttribute, DefinitionOptions, JIDAttribute, text } from '../jxt';
import { NS_DELAY } from '../Namespaces';
declare module './' {
export interface Message {
delay?: Delay;
}
export interface Presence {
delay?: Delay;
}
}
export interface Delay {
from?: string;
timestamp: Date;
reason?: string;
}
const Protocol: DefinitionOptions = {
aliases: ['message.delay', 'presence.delay'],
element: 'delay',
fields: {
from: JIDAttribute('from'),
reason: text(),
timestamp: dateAttribute('stamp')
},
namespace: NS_DELAY
};
export default Protocol;