anchor.diff:  
   logoff(UserId,ClientId) ->
       Transaction = fun() ->
  -                          case mnesia:wread({mqtt_presence,UserId}) of
  -                              [P=#mqtt_presence{clients=Clients}] ->
  -                                  NewClients = sets:del_element(ClientId,Clients),
  -                                  mnesia:write(P#mqtt_presence{clients=NewClients}),
  -                                  sets:size(NewClients)
  -                                  ;
  -                              _DoesNotExist ->
  -                                  mnesia:abort("No such presence object")
  -                          end
  -                  end,
  +            case mnesia:wread({mqtt_presence,UserId}) of
  +                [P=#mqtt_presence{clients=Clients}] ->
  +                    NewClients = sets:del_element(ClientId,Clients),
  +                    mnesia:write(P#mqtt_presence{clients=NewClients}),
  +                    sets:size(NewClients)
  +                    ;
  +                _DoesNotExist ->
  +                    mnesia:abort("No such presence object")
  +            end
  +    end,
       mnesia:transaction(Transaction).
  -
  -
  -
   
   -spec handle_message(mqtt_message(), context()) ->
       {reply, mqtt_message(), context(), timeout()} |
       {noreply, context(), timeout()} |
       {stop, Reason :: term()}.
   handle_message(
  -  Message=#mqtt_publish{topic = Topic, payload=Payload},
  -  Context=#?CONTEXT{session=Session, data=Data,client_id=ClientId}
  - ) when is_pid(Session) ->
  +            Message=#mqtt_publish{topic = Topic, payload=Payload},
  +            Context=#?CONTEXT{session=Session, data=Data,client_id=ClientId}
  +            ) when is_pid(Session) ->
       RegOpts = [{capture,all_but_first,binary}],
       case re:run(Topic, ?THREAD_REGEX, RegOpts) of
           {match, [ThreadId]} ->
  
positive.code:     end.
  
  update_status(Status,UserId,ClientId) ->
      Transaction =
      fun() ->
              case mnesia:wread({mqtt_presence,UserId}) of
                  [P=#mqtt_presence{clients=Clients,last_status=PrevStatus}] ->
                      NewClients = sets:add_element(ClientId,Clients),
  
negative.code: -spec init(params()) -> {noreply, context(), timeout()}.
  init(Params) ->
      random:seed(erlang:now()),
      mqtt_server:init(Params ++ [{data, [{objectid, objectid:objectid()}]}]).
  
  persist_message(Message,Context,Session,ThreadId,Body,Data) ->
      {_, ObjectId} = proplists:lookup(objectid, Data),
  