mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd:Ⓜ️ Rename breadcrumb_rooms to breadcrumbs; related.
This commit is contained in:
parent
3d175ced09
commit
8e7c1c3eb2
8 changed files with 48 additions and 48 deletions
|
@ -1,7 +1,7 @@
|
||||||
// Matrix Construct
|
// The Construct
|
||||||
//
|
//
|
||||||
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
// Copyright (C) The Construct Developers, Authors & Contributors
|
||||||
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
// Copyright (C) 2016-2020 Jason Volk <jason@zemos.net>
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, and/or distribute this software for any
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -9,14 +9,14 @@
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#define HAVE_IRCD_M_BREADCRUMB_ROOMS_H
|
#define HAVE_IRCD_M_BREADCRUMBS_H
|
||||||
|
|
||||||
namespace ircd::m
|
namespace ircd::m
|
||||||
{
|
{
|
||||||
struct breadcrumb_rooms;
|
struct breadcrumbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ircd::m::breadcrumb_rooms
|
struct ircd::m::breadcrumbs
|
||||||
{
|
{
|
||||||
using closure = std::function<void (const string_view &)>;
|
using closure = std::function<void (const string_view &)>;
|
||||||
using closure_bool = std::function<bool (const string_view &)>;
|
using closure_bool = std::function<bool (const string_view &)>;
|
||||||
|
@ -35,7 +35,7 @@ struct ircd::m::breadcrumb_rooms
|
||||||
event::id::buf add(const string_view &) const;
|
event::id::buf add(const string_view &) const;
|
||||||
event::id::buf del(const string_view &) const;
|
event::id::buf del(const string_view &) const;
|
||||||
|
|
||||||
breadcrumb_rooms(const m::user &user)
|
breadcrumbs(const m::user &user)
|
||||||
:account_data{user}
|
:account_data{user}
|
||||||
{}
|
{}
|
||||||
};
|
};
|
|
@ -92,7 +92,7 @@ namespace ircd
|
||||||
#include "bridge.h"
|
#include "bridge.h"
|
||||||
#include "sync/sync.h"
|
#include "sync/sync.h"
|
||||||
#include "fetch.h"
|
#include "fetch.h"
|
||||||
#include "breadcrumb_rooms.h"
|
#include "breadcrumbs.h"
|
||||||
#include "media.h"
|
#include "media.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
#include "gossip.h"
|
#include "gossip.h"
|
||||||
|
|
|
@ -134,7 +134,7 @@ libircd_matrix_la_SOURCES += user_rooms.cc
|
||||||
libircd_matrix_la_SOURCES += user_tokens.cc
|
libircd_matrix_la_SOURCES += user_tokens.cc
|
||||||
libircd_matrix_la_SOURCES += acquire.cc
|
libircd_matrix_la_SOURCES += acquire.cc
|
||||||
libircd_matrix_la_SOURCES += bridge.cc
|
libircd_matrix_la_SOURCES += bridge.cc
|
||||||
libircd_matrix_la_SOURCES += breadcrumb_rooms.cc
|
libircd_matrix_la_SOURCES += breadcrumbs.cc
|
||||||
libircd_matrix_la_SOURCES += burst.cc
|
libircd_matrix_la_SOURCES += burst.cc
|
||||||
libircd_matrix_la_SOURCES += display_name.cc
|
libircd_matrix_la_SOURCES += display_name.cc
|
||||||
libircd_matrix_la_SOURCES += event_append.cc
|
libircd_matrix_la_SOURCES += event_append.cc
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Matrix Construct
|
// The Construct
|
||||||
//
|
//
|
||||||
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
// Copyright (C) The Construct Developers, Authors & Contributors
|
||||||
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
// Copyright (C) 2016-2020 Jason Volk <jason@zemos.net>
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, and/or distribute this software for any
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::m::event::id::buf
|
ircd::m::event::id::buf
|
||||||
ircd::m::breadcrumb_rooms::set(const json::array &rooms)
|
ircd::m::breadcrumbs::set(const json::array &rooms)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
const json::strung object
|
const json::strung object
|
||||||
|
@ -20,11 +20,11 @@ const
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return account_data.set("im.vector.riot.breadcrumb_rooms", object);
|
return account_data.set("im.vector.setting.breadcrumbs", object);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ircd::m::breadcrumb_rooms::for_each(const closure_bool &closure)
|
ircd::m::breadcrumbs::for_each(const closure_bool &closure)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
bool ret{true};
|
bool ret{true};
|
||||||
|
@ -43,22 +43,22 @@ const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::m::breadcrumb_rooms::get(const closure &closure)
|
ircd::m::breadcrumbs::get(const closure &closure)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
if(!get(std::nothrow, closure))
|
if(!get(std::nothrow, closure))
|
||||||
throw m::NOT_FOUND
|
throw m::NOT_FOUND
|
||||||
{
|
{
|
||||||
"User has no breadcrumb_rooms set in their account_data."
|
"User has no breadcrumbs set in their account_data."
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ircd::m::breadcrumb_rooms::get(std::nothrow_t,
|
ircd::m::breadcrumbs::get(std::nothrow_t,
|
||||||
const closure &closure)
|
const closure &closure)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
return account_data.get(std::nothrow, "im.vector.riot.breadcrumb_rooms", [&closure]
|
return account_data.get(std::nothrow, "im.vector.setting.breadcrumbs", [&closure]
|
||||||
(const string_view &key, const json::object &object)
|
(const string_view &key, const json::object &object)
|
||||||
{
|
{
|
||||||
const json::array &rooms
|
const json::array &rooms
|
|
@ -57,7 +57,7 @@ ircd::m::matrix::module_names
|
||||||
"identity_v1",
|
"identity_v1",
|
||||||
|
|
||||||
"m_noop",
|
"m_noop",
|
||||||
"m_breadcrumb_rooms",
|
"m_breadcrumbs",
|
||||||
"m_bridge",
|
"m_bridge",
|
||||||
"m_command",
|
"m_command",
|
||||||
"m_control",
|
"m_control",
|
||||||
|
|
|
@ -88,7 +88,7 @@ endif IMAGEMAGICK
|
||||||
|
|
||||||
m_moduledir = @moduledir@
|
m_moduledir = @moduledir@
|
||||||
|
|
||||||
m_breadcrumb_rooms_la_SOURCES = m_breadcrumb_rooms.cc
|
m_breadcrumbs_la_SOURCES = m_breadcrumbs.cc
|
||||||
m_bridge_la_SOURCES = m_bridge.cc
|
m_bridge_la_SOURCES = m_bridge.cc
|
||||||
m_command_la_SOURCES = m_command.cc
|
m_command_la_SOURCES = m_command.cc
|
||||||
m_control_la_SOURCES = m_control.cc
|
m_control_la_SOURCES = m_control.cc
|
||||||
|
@ -119,7 +119,7 @@ m_room_third_party_invite_la_SOURCES = m_room_third_party_invite.cc
|
||||||
m_vm_fetch_la_SOURCES = m_vm_fetch.cc
|
m_vm_fetch_la_SOURCES = m_vm_fetch.cc
|
||||||
|
|
||||||
m_module_LTLIBRARIES = \
|
m_module_LTLIBRARIES = \
|
||||||
m_breadcrumb_rooms.la \
|
m_breadcrumbs.la \
|
||||||
m_bridge.la \
|
m_bridge.la \
|
||||||
m_command.la \
|
m_command.la \
|
||||||
m_control.la \
|
m_control.la \
|
||||||
|
|
|
@ -12809,7 +12809,7 @@ console_cmd__user__ignores(opt &out, const string_view &line)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
console_cmd__user__breadcrumb_rooms(opt &out, const string_view &line)
|
console_cmd__user__breadcrumbs(opt &out, const string_view &line)
|
||||||
{
|
{
|
||||||
const params param{line, " ",
|
const params param{line, " ",
|
||||||
{
|
{
|
||||||
|
@ -12821,12 +12821,12 @@ console_cmd__user__breadcrumb_rooms(opt &out, const string_view &line)
|
||||||
param.at("user_id")
|
param.at("user_id")
|
||||||
};
|
};
|
||||||
|
|
||||||
const m::breadcrumb_rooms breadcrumb_rooms
|
const m::breadcrumbs breadcrumbs
|
||||||
{
|
{
|
||||||
user_id
|
user_id
|
||||||
};
|
};
|
||||||
|
|
||||||
breadcrumb_rooms.for_each([&out]
|
breadcrumbs.for_each([&out]
|
||||||
(const string_view &room_id)
|
(const string_view &room_id)
|
||||||
{
|
{
|
||||||
out << room_id << std::endl;
|
out << room_id << std::endl;
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
|
|
||||||
namespace ircd::m
|
namespace ircd::m
|
||||||
{
|
{
|
||||||
static void handle_breadcrumb_rooms_focus_out(const event &, vm::eval &, const json::array &);
|
static void handle_breadcrumbs_focus_out(const event &, vm::eval &, const json::array &);
|
||||||
static void handle_breadcrumb_rooms_focus_in(const event &, vm::eval &, const json::array &);
|
static void handle_breadcrumbs_focus_in(const event &, vm::eval &, const json::array &);
|
||||||
static void handle_breadcrumb_rooms(const event &, vm::eval &);
|
static void handle_breadcrumbs(const event &, vm::eval &);
|
||||||
extern hookfn<vm::eval &> hook_breadcrumb_rooms;
|
extern hookfn<vm::eval &> hook_breadcrumbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
ircd::mapi::header
|
ircd::mapi::header
|
||||||
|
@ -22,20 +22,20 @@ IRCD_MODULE
|
||||||
"Matrix Breadcrumb Rooms"
|
"Matrix Breadcrumb Rooms"
|
||||||
};
|
};
|
||||||
|
|
||||||
decltype(ircd::m::hook_breadcrumb_rooms)
|
decltype(ircd::m::hook_breadcrumbs)
|
||||||
ircd::m::hook_breadcrumb_rooms
|
ircd::m::hook_breadcrumbs
|
||||||
{
|
{
|
||||||
handle_breadcrumb_rooms,
|
handle_breadcrumbs,
|
||||||
{
|
{
|
||||||
{ "_site", "vm.effect" },
|
{ "_site", "vm.effect" },
|
||||||
{ "type", "ircd.account_data" },
|
{ "type", "ircd.account_data" },
|
||||||
{ "state_key", "im.vector.riot.breadcrumb_rooms" },
|
{ "state_key", "im.vector.setting.breadcrumbs" },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::m::handle_breadcrumb_rooms(const event &event,
|
ircd::m::handle_breadcrumbs(const event &event,
|
||||||
vm::eval &eval)
|
vm::eval &eval)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const m::user::id &sender
|
const m::user::id &sender
|
||||||
|
@ -59,11 +59,11 @@ try
|
||||||
|
|
||||||
const json::array &rooms
|
const json::array &rooms
|
||||||
{
|
{
|
||||||
content.get("rooms")
|
content.get("recent_rooms")
|
||||||
};
|
};
|
||||||
|
|
||||||
handle_breadcrumb_rooms_focus_out(event, eval, rooms);
|
handle_breadcrumbs_focus_out(event, eval, rooms);
|
||||||
handle_breadcrumb_rooms_focus_in(event, eval, rooms);
|
handle_breadcrumbs_focus_in(event, eval, rooms);
|
||||||
}
|
}
|
||||||
catch(const ctx::interrupted &)
|
catch(const ctx::interrupted &)
|
||||||
{
|
{
|
||||||
|
@ -73,15 +73,15 @@ catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
log::error
|
log::error
|
||||||
{
|
{
|
||||||
m::log, "breadcrumb_rooms hook :%s",
|
m::log, "breadcrumbs hook :%s",
|
||||||
e.what(),
|
e.what(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::m::handle_breadcrumb_rooms_focus_in(const event &event,
|
ircd::m::handle_breadcrumbs_focus_in(const event &event,
|
||||||
vm::eval &eval,
|
vm::eval &eval,
|
||||||
const json::array &rooms)
|
const json::array &rooms)
|
||||||
{
|
{
|
||||||
const room::id &focus_in
|
const room::id &focus_in
|
||||||
{
|
{
|
||||||
|
@ -108,9 +108,9 @@ ircd::m::handle_breadcrumb_rooms_focus_in(const event &event,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::m::handle_breadcrumb_rooms_focus_out(const event &event,
|
ircd::m::handle_breadcrumbs_focus_out(const event &event,
|
||||||
vm::eval &eval,
|
vm::eval &eval,
|
||||||
const json::array &rooms)
|
const json::array &rooms)
|
||||||
{
|
{
|
||||||
const room::id &focus_out
|
const room::id &focus_out
|
||||||
{
|
{
|
Loading…
Reference in a new issue