Skip to content

Commit

Permalink
modules/media: Eliminate blocks database; encode data into event cont…
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Aug 21, 2020
1 parent 083fee2 commit eb0f1f7
Show file tree
Hide file tree
Showing 5 changed files with 525 additions and 764 deletions.
19 changes: 6 additions & 13 deletions include/ircd/m/media.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
namespace ircd::m::media
{
struct mxc;

extern log::log log;
extern conf::item<size_t> events_prefetch;
extern conf::item<seconds> download_timeout;
extern std::set<m::room::id> downloading;
extern ctx::dock downloading_dock;
}

namespace ircd::m::media::file
Expand Down Expand Up @@ -44,19 +50,6 @@ namespace ircd::m::media::file
string_view remote = {});
};

namespace ircd::m::media::block
{
using closure = std::function<void (const const_buffer &)>;

bool prefetch(const string_view &hash);
bool get(const string_view &hash, const closure &);
const_buffer get(const mutable_buffer &out, const string_view &hash);

void set(const string_view &hash, const const_buffer &block);
string_view set(const mutable_buffer &hashbuf, const const_buffer &block);
m::event::id::buf set(const room &, const user::id &, const const_buffer &block);
}

struct ircd::m::media::mxc
{
string_view server;
Expand Down
1 change: 1 addition & 0 deletions matrix/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ libircd_matrix_la_SOURCES += gossip.cc
libircd_matrix_la_SOURCES += groups.cc
libircd_matrix_la_SOURCES += request.cc
libircd_matrix_la_SOURCES += keys.cc
libircd_matrix_la_SOURCES += media.cc
libircd_matrix_la_SOURCES += node.cc
libircd_matrix_la_SOURCES += presence.cc
libircd_matrix_la_SOURCES += pretty.cc
Expand Down
Loading

0 comments on commit eb0f1f7

Please sign in to comment.