payload_xmlelements(Tail, Count).
items_event_stanza(Node, Options, Items) ->
- NotificationType = get_option(Options, notification_type, headline),
MoreEls = case Items of
[LastItem] ->
{ModifNow, ModifUSR} = LastItem#pubsub_item.modification,
_ ->
[]
end,
- event_stanza_with_els([#xmlel{name = <<"items">>,
- attrs = case NotificationType of
- normal -> nodeAttr(Node);
- _ -> [{<<"type">>, jlib:atom_to_binary(NotificationType)}
- | nodeAttr(Node)]
- end,
+ BaseStanza = event_stanza_with_els([#xmlel{name = <<"items">>,
+ attrs = nodeAttr(Node),
children = itemsEls(Items)}],
- MoreEls).
+ MoreEls),
+ NotificationType = get_option(Options, notification_type, headline),
+ add_message_type(BaseStanza, NotificationType).
event_stanza(Els) ->
event_stanza_with_els(Els, []).