-
Notifications
You must be signed in to change notification settings - Fork 251
/
xep0108.ts
39 lines (35 loc) · 1.28 KB
/
xep0108.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
// ====================================================================
// XEP-0108: User Activity
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0108.html
// Version: 1.3 (2008-10-29)
// ====================================================================
import { USER_ACTIVITY_GENERAL, USER_ACTIVITY_SPECIFIC } from '../Constants';
import {
childAlternateLanguageText,
childDoubleEnum,
childText,
DefinitionOptions,
LanguageSet,
pubsubItemContentAliases
} from '../jxt';
import { NS_ACTIVITY } from '../Namespaces';
import { PubsubItemContent } from './';
export interface UserActivity extends PubsubItemContent {
itemType?: typeof NS_ACTIVITY;
activity: [string] | [string, string];
text?: string;
alternateLanguageText?: LanguageSet<string>;
}
const Protocol: DefinitionOptions = {
aliases: [{ path: 'activity', impliedType: true }, ...pubsubItemContentAliases()],
element: 'activity',
fields: {
activity: childDoubleEnum(null, USER_ACTIVITY_GENERAL, USER_ACTIVITY_SPECIFIC),
alternateLanguageText: childAlternateLanguageText(null, 'text'),
text: childText(null, 'text')
},
namespace: NS_ACTIVITY,
type: NS_ACTIVITY
};
export default Protocol;