summaryrefslogtreecommitdiffstats
blob: 2d4452aa676c4c1e99e9db0027d4d0ea92ab9e22 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
 * Copyright (c) 2013 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <Swiften/Elements/Payload.h>

namespace Swift {
    class SWIFTEN_API PubSubError : public Payload {
        public:
            enum Type {
                UnknownType = 0,
                ClosedNode,
                ConfigurationRequired,
                InvalidJID,
                InvalidOptions,
                InvalidPayload,
                InvalidSubscriptionID,
                ItemForbidden,
                ItemRequired,
                JIDRequired,
                MaximumItemsExceeded,
                MaximumNodesExceeded,
                NodeIDRequired,
                NotInRosterGroup,
                NotSubscribed,
                PayloadTooBig,
                PayloadRequired,
                PendingSubscription,
                PresenceSubscriptionRequired,
                SubscriptionIDRequired,
                TooManySubscriptions,
                Unsupported,
                UnsupportedAccessModel
            };

            enum UnsupportedFeatureType {
                UnknownUnsupportedFeatureType = 0,
                AccessAuthorize,
                AccessOpen,
                AccessPresence,
                AccessRoster,
                AccessWhitelist,
                AutoCreate,
                AutoSubscribe,
                Collections,
                ConfigNode,
                CreateAndConfigure,
                CreateNodes,
                DeleteItems,
                DeleteNodes,
                FilteredNotifications,
                GetPending,
                InstantNodes,
                ItemIDs,
                LastPublished,
                LeasedSubscription,
                ManageSubscriptions,
                MemberAffiliation,
                MetaData,
                ModifyAffiliations,
                MultiCollection,
                MultiSubscribe,
                OutcastAffiliation,
                PersistentItems,
                PresenceNotifications,
                PresenceSubscribe,
                Publish,
                PublishOptions,
                PublishOnlyAffiliation,
                PublisherAffiliation,
                PurgeNodes,
                RetractItems,
                RetrieveAffiliations,
                RetrieveDefault,
                RetrieveItems,
                RetrieveSubscriptions,
                Subscribe,
                SubscriptionOptions,
                SubscriptionNotifications
            };

            PubSubError(Type type = UnknownType) : type(type), unsupportedType(UnknownUnsupportedFeatureType) {
            }

            virtual ~PubSubError();

            Type getType() const {
                return type;
            }

            void setType(Type type) {
                this->type = type;
            }

            UnsupportedFeatureType getUnsupportedFeatureType() const {
                return unsupportedType;
            }

            void setUnsupportedFeatureType(UnsupportedFeatureType unsupportedType) {
                this->unsupportedType = unsupportedType;
            }

        private:
            Type type;
            UnsupportedFeatureType unsupportedType;
    };
}