anchor.diff:      Subs1 = lists:foldl(fun maybe_add_sub/2,Subs,NewSubs),
       S#outgoing{subs = Subs1}.
   
  -maybe_add_sub({Filter,QoS},Subs) ->
  -    NewSub =
  +maybe_add_sub({Filter,QoS,Seq},Subs) ->
  +    ShouldInsert =
           case orddict:find(Filter,Subs) of
  -            {ok,{_,Seq}} -> {QoS,Seq};
  -            error        -> {QoS,undefined}
  +            {ok,{_,SeqOld}} when SeqOld < Seq -> true;
  +            _ -> true
           end,
  -    orddict:store(Filter,NewSub,Subs).
  +    if ShouldInsert -> orddict:store(Filter,{QoS,Seq},Subs);
  +       true -> Subs
  +    end.
  +
   
   %% @doc
   %% Removes existing subscriptions from the session data
  
positive.code: %% =========================================================================
  %% MESSAGES
  %% =========================================================================
  
  push(Filter,Packet = #packet{seq = Seq},SO = #outgoing{subs = Subs}) ->
      case should_accept(Filter,Subs) of
  
negative.code: 
  unsubscribe(OldSubs,S = #outgoing{subs = Subs,queue = Q}) ->
      Subs1 = lists:foldl(fun orddict:erase/2,Subs,OldSubs),
      S#outgoing{subs = Subs1,queue = flush_queue(OldSubs,Q)}.
  
  flush_queue(OldSubs,Q) ->
      queue:filter(fun({Filter,_}) -> lists:member(Filter,OldSubs) end,Q).
  