Skip to content

Commit

Permalink
mod_mam: Reject <index/>-based paging
Browse files Browse the repository at this point in the history
If an <index/> is specified in the MAM request, reject the request
rather than ignoring the desired index and returning wrong results.
XEP-0059 says that the server "MAY return a <feature-not-implemented/>
error."
  • Loading branch information
weiss committed Jan 14, 2016
1 parent 11afa45 commit 35ec0d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mod_mam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ process_iq(LServer, #jid{luser = LUser} = From, To, IQ, SubEl, Fs, MsgType) ->
end, {none, [], none, none}, Fs) of
{'EXIT', _} ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_BAD_REQUEST]};
{_Start, _End, _With, #rsm_in{index = Index}} when is_integer(Index) ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_FEATURE_NOT_IMPLEMENTED]};
{Start, End, With, RSM} ->
select_and_send(LServer, From, To, Start, End,
With, RSM, IQ, MsgType)
Expand Down

0 comments on commit 35ec0d5

Please sign in to comment.