Skip to content

Commit

Permalink
modules/client/presence: Remove presence lists stub. (matrix-org/matr…
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Aug 16, 2019
1 parent 593c21c commit 183241b
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions modules/client/presence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ get__presence_status(client &,
const resource::request &,
const m::user::id &);

static resource::response
get__presence_list(client &,
const resource::request &);

resource::response
get__presence(client &client,
const resource::request &request)
Expand All @@ -59,9 +55,6 @@ get__presence(client &client,
"user_id or command required"
};

if(request.parv[0] == "list")
return get__presence_list(client, request);

m::user::id::buf user_id
{
url::decode(user_id, request.parv[0])
Expand Down Expand Up @@ -109,37 +102,6 @@ get__presence_status(client &client,
return {}; // responded from closure or threw
}

resource::response
get__presence_list(client &client,
const resource::request &request)
{
if(request.parv.size() < 2)
throw m::NEED_MORE_PARAMS
{
"user_id required"
};

m::user::id::buf user_id
{
url::decode(user_id, request.parv[1])
};

const m::user::room user_room
{
user_id
};

//TODO: reuse composition from /status
std::vector<json::value> list;
return resource::response
{
client, json::value
{
list.data(), list.size()
}
};
}

//
// POST ?
//
Expand All @@ -157,10 +119,6 @@ method_post
}
};

static resource::response
post__presence_list(client &,
const resource::request &);

resource::response
post__presence(client &client,
const resource::request &request)
Expand All @@ -171,41 +129,12 @@ post__presence(client &client,
"command required"
};

if(request.parv[0] == "list")
return get__presence_list(client, request);

throw m::NOT_FOUND
{
"Presence command not found"
};
}

resource::response
post__presence_list(client &client,
const resource::request &request)
{
if(request.parv.size() < 2)
throw m::NEED_MORE_PARAMS
{
"user_id required"
};

m::user::id::buf user_id
{
url::decode(user_id, request.parv[1])
};

const m::user::room user_room
{
user_id
};

return resource::response
{
client, http::OK
};
}

//
// put
//
Expand Down

0 comments on commit 183241b

Please sign in to comment.