mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
xep-0107: adapting the pubsub/headline code
Like mentioned on the review at https://github.com/profanity-im/profanity/pull/1605 I don't ge why @DebXWoody changed the code like he did. I changed it to something that made more sense to me now. Instead of looking for headline in two places and checking for pubsub in a headline place (only). I didn't check this deeply. And still have a feeling that this is not the best way to go. But I didn't read the XEP yet. Added a TODO to the code regarding this too. A quick skimming through https://xmpp.org/extensions/xep-0107.html doesn't show me anything regarding headline. So I really don't see why this needs to go here. Hopefully @DebXWoody checks this in the future. But since he didn't react on the PR I decided to make some adjustments myself so we can merge it.
This commit is contained in:
parent
67fea6f3c4
commit
6c3e6a5262
@ -164,9 +164,12 @@ _message_handler(xmpp_conn_t* const conn, xmpp_stanza_t* const stanza, void* con
|
||||
|
||||
} else if (type && g_strcmp0(type, STANZA_TYPE_HEADLINE) == 0) {
|
||||
xmpp_stanza_t* event = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_PUBSUB_EVENT);
|
||||
// TODO: do we want to handle all pubsub here or should additionaly check for STANZA_NS_MOOD?
|
||||
if (event) {
|
||||
_handle_pubsub(stanza, event);
|
||||
return 1;
|
||||
} else {
|
||||
_handle_headline(stanza);
|
||||
}
|
||||
} else if (type == NULL || g_strcmp0(type, STANZA_TYPE_CHAT) == 0 || g_strcmp0(type, STANZA_TYPE_NORMAL) == 0) {
|
||||
// type: chat, normal (==NULL)
|
||||
@ -252,8 +255,6 @@ _message_handler(xmpp_conn_t* const conn, xmpp_stanza_t* const stanza, void* con
|
||||
if (msg_stanza) {
|
||||
_handle_chat(msg_stanza, FALSE, is_carbon, NULL, NULL);
|
||||
}
|
||||
} else if (type && g_strcmp0(type, STANZA_TYPE_HEADLINE) == 0) {
|
||||
_handle_headline(stanza);
|
||||
} else {
|
||||
// none of the allowed types
|
||||
char* text;
|
||||
|
Loading…
Reference in New Issue
Block a user