2018-02-22 00:22:04 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
#include "rooms.h"
|
|
|
|
|
2018-02-23 04:43:23 +01:00
|
|
|
using namespace ircd::m;
|
2018-02-22 00:22:04 +01:00
|
|
|
using namespace ircd;
|
|
|
|
|
|
|
|
resource::response
|
|
|
|
post__leave(client &client,
|
|
|
|
const resource::request &request,
|
2018-02-23 04:43:23 +01:00
|
|
|
const room::id &room_id)
|
2018-02-22 00:22:04 +01:00
|
|
|
{
|
2019-03-08 19:07:17 +01:00
|
|
|
const m::room room
|
2018-02-22 00:22:04 +01:00
|
|
|
{
|
2019-03-08 19:07:17 +01:00
|
|
|
room_id
|
2018-02-22 00:22:04 +01:00
|
|
|
};
|
2018-02-23 04:43:23 +01:00
|
|
|
|
2019-03-08 19:07:17 +01:00
|
|
|
const auto event_id
|
2018-02-23 04:43:23 +01:00
|
|
|
{
|
2019-03-08 19:07:17 +01:00
|
|
|
send(room, request.user_id, "m.room.member", request.user_id,
|
|
|
|
{
|
|
|
|
{ "membership", "leave" }
|
|
|
|
})
|
2018-02-23 04:43:23 +01:00
|
|
|
};
|
|
|
|
|
2019-03-08 19:07:17 +01:00
|
|
|
return resource::response
|
|
|
|
{
|
|
|
|
client, http::OK, json::members
|
|
|
|
{
|
|
|
|
{ "event_id", event_id }
|
|
|
|
}
|
|
|
|
};
|
2018-02-23 04:43:23 +01:00
|
|
|
}
|