Skip to content

Commit

Permalink
Fix message stanza with body changing MUC subject (dino#1569)
Browse files Browse the repository at this point in the history
- fixes dino#1542
            - more consistent with
              https://xmpp.org/extensions/xep-0045.html#enter-subject:
                    "Note: In accordance with the core definition of XML stanzas,
                    any message can contain a <subject/> element; only a message that
                    contains a <subject/> but no <body/> element shall be considered a
                    subject change for MUC purposes."
  • Loading branch information
eerielili authored and mxlgv committed Apr 1, 2024
1 parent d6a6bdc commit e5302d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xmpp-vala/src/module/xep/0045_muc/module.vala
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public class Module : XmppStreamModule {
private void on_received_message(XmppStream stream, MessageStanza message) {
if (message.type_ == MessageStanza.TYPE_GROUPCHAT) {
StanzaNode? subject_node = message.stanza.get_subnode("subject");
if (subject_node != null) {
if (subject_node != null && message.body == null){
string subject = subject_node.get_string_content();
stream.get_flag(Flag.IDENTITY).set_muc_subject(message.from, subject);
subject_set(stream, subject, message.from);
Expand Down

0 comments on commit e5302d1

Please sign in to comment.