forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep0066.ts
47 lines (41 loc) · 1.18 KB
/
xep0066.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
44
45
46
47
// ====================================================================
// XEP-0066: Out of Band Data
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0066.html
// Version: 1.5 (2006-08-16)
// ====================================================================
import { childText, DefinitionOptions } from '../jxt';
import { NS_OOB, NS_OOB_TRANSFER } from '../Namespaces';
declare module './' {
export interface Message {
links?: Link[];
}
export interface IQPayload {
transferLink?: Link;
}
}
export interface Link {
url?: string;
description?: string;
}
const Protocol: DefinitionOptions[] = [
{
aliases: [{ multiple: true, path: 'message.links' }],
element: 'x',
fields: {
description: childText(null, 'desc'),
url: childText(null, 'url')
},
namespace: NS_OOB
},
{
element: 'query',
fields: {
description: childText(null, 'desc'),
url: childText(null, 'url')
},
namespace: NS_OOB_TRANSFER,
path: 'iq.transferLink'
}
];
export default Protocol;