forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep0115.ts
41 lines (36 loc) · 1.16 KB
/
xep0115.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
// ====================================================================
// XEP-0115: Entity Capabilities
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0115.html
// Version: 1.5.1 (2016-10-06)
// ====================================================================
import { attribute, DefinitionOptions, staticValue } from '../jxt';
import { NS_DISCO_LEGACY_CAPS } from '../Namespaces';
declare module './' {
export interface StreamFeatures {
legacyCapabilities?: LegacyEntityCaps[];
}
export interface Presence {
legacyCapabilities?: LegacyEntityCaps[];
}
}
export interface LegacyEntityCaps {
node: string;
value: string;
algorithm: string;
}
const Protocol: DefinitionOptions = {
aliases: [
{ path: 'presence.legacyCapabilities', multiple: true },
{ path: 'features.legacyCapabilities', multiple: true }
],
element: 'c',
fields: {
algorithm: attribute('hash'),
legacy: staticValue(true),
node: attribute('node'),
value: attribute('ver')
},
namespace: NS_DISCO_LEGACY_CAPS
};
export default Protocol;