diff options
Diffstat (limited to 'Presence/Stanza/Types.hs')
-rw-r--r-- | Presence/Stanza/Types.hs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Presence/Stanza/Types.hs b/Presence/Stanza/Types.hs index 6c5b8867..7275c8ab 100644 --- a/Presence/Stanza/Types.hs +++ b/Presence/Stanza/Types.hs | |||
@@ -70,6 +70,7 @@ data StanzaType | |||
70 | | PresenceRequestSubscription Bool | 70 | | PresenceRequestSubscription Bool |
71 | | Message { msgThread :: Maybe MessageThread | 71 | | Message { msgThread :: Maybe MessageThread |
72 | , msgLangMap :: [(Lang,LangSpecificMessage)] | 72 | , msgLangMap :: [(Lang,LangSpecificMessage)] |
73 | , msgType :: MessageType | ||
73 | } | 74 | } |
74 | | NotifyClientVersion { versionName :: Text | 75 | | NotifyClientVersion { versionName :: Text |
75 | , versionVersion :: Text } | 76 | , versionVersion :: Text } |
@@ -77,6 +78,60 @@ data StanzaType | |||
77 | | InternalCacheId Text | 78 | | InternalCacheId Text |
78 | deriving (Show,Eq) | 79 | deriving (Show,Eq) |
79 | 80 | ||
81 | data MessageType | ||
82 | = NormalMsg -- ^ The message is a standalone message that is sent outside | ||
83 | -- the context of a one-to-one conversation or groupchat, and | ||
84 | -- to which it is expected that the recipient will reply. | ||
85 | -- Typically a receiving client will present a message of type | ||
86 | -- "normal" in an interface that enables the recipient to | ||
87 | -- reply, but without a conversation history. The default | ||
88 | -- value of the 'type' attribute is "normal". | ||
89 | |||
90 | | ChatMsg -- ^ The message is sent in the context of a one-to-one chat | ||
91 | -- session. Typically an interactive client will present a | ||
92 | -- message of type "chat" in an interface that enables one-to-one | ||
93 | -- chat between the two parties, including an appropriate | ||
94 | -- conversation history. Detailed recommendations regarding | ||
95 | -- one-to-one chat sessions are provided under Section 5.1. | ||
96 | |||
97 | | GroupChatMsg -- ^ The message is sent in the context of a multi-user chat | ||
98 | -- environment (similar to that of [IRC]). Typically a | ||
99 | -- receiving client will present a message of type | ||
100 | -- "groupchat" in an interface that enables many-to-many | ||
101 | -- chat between the parties, including a roster of parties | ||
102 | -- in the chatroom and an appropriate conversation history. | ||
103 | -- For detailed information about XMPP-based groupchat, | ||
104 | -- refer to [XEP‑0045]. | ||
105 | |||
106 | | HeadlineMsg -- ^ The message provides an alert, a notification, or other | ||
107 | -- transient information to which no reply is expected (e.g., | ||
108 | -- news headlines, sports updates, near-real-time market | ||
109 | -- data, or syndicated content). Because no reply to the | ||
110 | -- message is expected, typically a receiving client will | ||
111 | -- present a message of type "headline" in an interface that | ||
112 | -- appropriately differentiates the message from standalone | ||
113 | -- messages, chat messages, and groupchat messages (e.g., by | ||
114 | -- not providing the recipient with the ability to reply). If | ||
115 | -- the 'to' address is the bare JID, the receiving server | ||
116 | -- SHOULD deliver the message to all of the recipient's | ||
117 | -- available resources with non-negative presence priority | ||
118 | -- and MUST deliver the message to at least one of those | ||
119 | -- resources; if the 'to' address is a full JID and there is | ||
120 | -- a matching resource, the server MUST deliver the message | ||
121 | -- to that resource; otherwise the server MUST either | ||
122 | -- silently ignore the message or return an error (see | ||
123 | -- Section 8). | ||
124 | |||
125 | -- | ErrorMsg -- The message is generated by an entity that experiences an | ||
126 | -- error when processing a message received from another entity (for | ||
127 | -- details regarding stanza error syntax, refer to [XMPP‑CORE]). A client | ||
128 | -- that receives a message of type "error" SHOULD present an appropriate | ||
129 | -- interface informing the original sender regarding the nature of the | ||
130 | -- error. | ||
131 | |||
132 | deriving (Show,Read,Ord,Eq,Enum) | ||
133 | |||
134 | |||
80 | data RosterEventType | 135 | data RosterEventType |
81 | = RequestedSubscription | 136 | = RequestedSubscription |
82 | | NewBuddy -- preceded by PresenceInformSubscription True | 137 | | NewBuddy -- preceded by PresenceInformSubscription True |