mirror of
https://github.com/profanity-im/profanity.git
synced 2025-07-26 12:14:28 -04:00
message: simplify _handle_headline
This commit is contained in:
parent
b2a02424ed
commit
1f96e14ce7
@ -116,14 +116,12 @@ _handled_by_plugin(xmpp_stanza_t* const stanza)
|
|||||||
static void
|
static void
|
||||||
_handle_headline(xmpp_stanza_t* const stanza)
|
_handle_headline(xmpp_stanza_t* const stanza)
|
||||||
{
|
{
|
||||||
xmpp_ctx_t* ctx = connection_get_ctx();
|
|
||||||
char* text = NULL;
|
|
||||||
xmpp_stanza_t* body = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_BODY);
|
xmpp_stanza_t* body = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_BODY);
|
||||||
if (body) {
|
if (body) {
|
||||||
text = xmpp_stanza_get_text(body);
|
char *text = xmpp_stanza_get_text(body);
|
||||||
if (text) {
|
if (text) {
|
||||||
cons_show("Headline: %s", text);
|
cons_show("Headline: %s", text);
|
||||||
xmpp_free(ctx, text);
|
xmpp_free(connection_get_ctx(), text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user