-
Notifications
You must be signed in to change notification settings - Fork 251
/
xep0202.ts
32 lines (27 loc) · 836 Bytes
/
xep0202.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
// ====================================================================
// XEP-0202: Entity Time
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0202.html
// Version: 2.0 (2009-09-15)
// ====================================================================
import { childDate, childTimezoneOffset, DefinitionOptions } from '../jxt';
import { NS_TIME } from '../Namespaces';
declare module './' {
export interface IQPayload {
time?: EntityTime;
}
}
export interface EntityTime {
utc?: Date;
tzo?: number;
}
const Protocol: DefinitionOptions = {
element: 'time',
fields: {
tzo: childTimezoneOffset(null, 'tzo'),
utc: childDate(null, 'utc')
},
namespace: NS_TIME,
path: 'iq.time'
};
export default Protocol;