forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep0184.ts
42 lines (37 loc) · 1.04 KB
/
xep0184.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
// ====================================================================
// XEP-0184: Message Delivery Receipts
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0184.html
// Version: 1.2 (2011-03-01)
// ====================================================================
import { attribute, DefinitionOptions } from '../jxt';
import { NS_RECEIPTS } from '../Namespaces';
declare module './' {
export interface Message {
receipt?: MessageReceipt;
}
}
export interface MessageReceipt {
type: 'request' | 'received';
id?: string;
}
const Protocol: DefinitionOptions[] = [
{
element: 'request',
namespace: NS_RECEIPTS,
path: 'message.receipt',
type: 'request',
typeField: 'type'
},
{
element: 'received',
fields: {
id: attribute('id')
},
namespace: NS_RECEIPTS,
path: 'message.receipt',
type: 'received',
typeField: 'type'
}
];
export default Protocol;