forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep0012.ts
43 lines (39 loc) · 1.27 KB
/
xep0012.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
// ====================================================================
// XEP-0012: Last Activity
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0012.html
// Version: 2.0 (2008-11-26)
//
// Additional:
// --------------------------------------------------------------------
// XEP-0256: Last Activity in Presence
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0256.html
// Version: 1.1 (2009-09-15)
// ====================================================================
import { DefinitionOptions, integerAttribute, text } from '../jxt';
import { NS_LAST_ACTIVITY } from '../Namespaces';
declare module './' {
export interface IQPayload {
lastActivity?: LastActivity;
}
export interface Presence {
legacyLastActivity?: LastActivity;
}
}
export interface LastActivity {
seconds?: number;
status?: string;
}
const Protocol: DefinitionOptions[] = [
{
aliases: ['presence.legacyLastActivity', 'iq.lastActivity'],
element: 'query',
fields: {
seconds: integerAttribute('seconds'),
status: text()
},
namespace: NS_LAST_ACTIVITY
}
];
export default Protocol;