Pkt1 = strip_my_stanza_id(Pkt, LServer),
xmpp:put_meta(Pkt1, stanza_id, ID).
+-spec set_stanza_id(stanza(), jid(), integer()) -> stanza().
set_stanza_id(Pkt, JID, ID) ->
BareJID = jid:remove_resource(JID),
Archived = #mam_archived{by = BareJID, id = ID},
end
end.
+-spec should_archive(message(), binary()) -> boolean().
should_archive(#message{type = error}, _LServer) ->
false;
should_archive(#message{meta = #{from_offline := true}}, _LServer) ->
end
end.
+-spec should_archive_muc(message()) -> boolean().
should_archive_muc(#message{type = groupchat,
body = Body, subject = Subj} = Pkt) ->
case check_store_hint(Pkt) of
should_archive_muc(_) ->
false.
+-spec check_store_hint(message()) -> store | no_store | none.
check_store_hint(Pkt) ->
case has_store_hint(Pkt) of
true ->
false
end.
+-spec may_enter_room(jid(), mod_muc_room:state()) -> boolean().
may_enter_room(From,
#state{config = #config{members_only = false}} = MUCState) ->
mod_muc_room:get_affiliation(From, MUCState) /= outcast;
pass
end.
+-spec store_muc(mod_muc_room:state(), message(), jid(), jid(), binary())
+ -> ok | pass | any().
store_muc(MUCState, Pkt, RoomJID, Peer, Nick) ->
case should_archive_muc(Pkt) of
true ->