2018-02-21 15:22:04 -08: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"
|
|
|
|
|
|
|
|
using namespace ircd;
|
|
|
|
|
2019-09-28 16:12:07 -07:00
|
|
|
m::resource::response
|
2018-02-21 15:22:04 -08:00
|
|
|
post__leave(client &client,
|
2019-09-28 16:12:07 -07:00
|
|
|
const m::resource::request &request,
|
2019-08-25 18:39:01 -07:00
|
|
|
const m::room::id &room_id)
|
2018-02-21 15:22:04 -08:00
|
|
|
{
|
2019-03-08 10:07:17 -08:00
|
|
|
const m::room room
|
2018-02-21 15:22:04 -08:00
|
|
|
{
|
2019-03-08 10:07:17 -08:00
|
|
|
room_id
|
2018-02-21 15:22:04 -08:00
|
|
|
};
|
2018-02-22 19:43:23 -08:00
|
|
|
|
2019-03-08 10:07:17 -08:00
|
|
|
const auto event_id
|
2018-02-22 19:43:23 -08:00
|
|
|
{
|
2019-04-22 13:29:03 -07:00
|
|
|
m::leave(room, request.user_id)
|
2018-02-22 19:43:23 -08:00
|
|
|
};
|
|
|
|
|
2019-09-28 16:12:07 -07:00
|
|
|
return m::resource::response
|
2019-03-08 10:07:17 -08:00
|
|
|
{
|
|
|
|
client, http::OK, json::members
|
|
|
|
{
|
|
|
|
{ "event_id", event_id }
|
|
|
|
}
|
|
|
|
};
|
2018-02-22 19:43:23 -08:00
|
|
|
}
|