forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep0317.ts
36 lines (32 loc) · 937 Bytes
/
xep0317.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
// ====================================================================
// XEP-0317: Hats
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0317.html
// Version: 0.1 (2013-01-03)
// ====================================================================
import { attribute, DefinitionOptions, extendPresence, splicePath } from '../jxt';
import { NS_HATS_0 } from '../Namespaces';
declare module './' {
export interface Presence {
hats?: Hat[];
}
}
export interface Hat {
id: string;
name?: string;
}
const Protocol: DefinitionOptions[] = [
extendPresence({
hats: splicePath(NS_HATS_0, 'hats', 'hat', true)
}),
{
element: 'hat',
fields: {
id: attribute('name'),
name: attribute('displayName')
},
namespace: NS_HATS_0,
path: 'hat'
}
];
export default Protocol;