0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-26 05:48:20 +02:00

modules/client/sync: Minor cleanup;

modules/client/sync: Consolidate header.
This commit is contained in:
Jason Volk 2019-09-09 12:05:53 -07:00
parent 3e694d50cf
commit 5b088551ae
15 changed files with 107 additions and 117 deletions

View file

@ -8,7 +8,35 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
#include "sync.h"
namespace ircd::m::sync
{
struct args;
struct stats;
struct data;
struct response;
static const_buffer flush(data &, resource::response::chunked &, const const_buffer &);
static void empty_response(data &, const uint64_t &next_batch);
static bool linear_handle(data &);
static bool polylog_handle(data &);
static bool longpoll_handle(data &);
static resource::response handle_get(client &, const resource::request &);
extern conf::item<size_t> flush_hiwat;
extern conf::item<size_t> buffer_size;
extern conf::item<size_t> linear_buffer_size;
extern conf::item<size_t> linear_delta_max;
extern conf::item<bool> longpoll_enable;
extern conf::item<bool> polylog_phased;
extern conf::item<bool> polylog_only;
extern resource::method method_get;
extern const string_view description;
extern resource resource;
}
#include "sync/args.h"
ircd::mapi::header
IRCD_MODULE

View file

@ -1,38 +0,0 @@
// 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.
namespace ircd::m::sync
{
struct args;
struct stats;
struct data;
struct response;
extern const string_view description;
extern resource resource;
extern resource::method method_get;
extern conf::item<size_t> flush_hiwat;
extern conf::item<size_t> buffer_size;
extern conf::item<size_t> linear_buffer_size;
extern conf::item<size_t> linear_delta_max;
extern conf::item<bool> longpoll_enable;
extern conf::item<bool> polylog_phased;
extern conf::item<bool> polylog_only;
static const_buffer flush(data &, resource::response::chunked &, const const_buffer &);
static void empty_response(data &, const uint64_t &next_batch);
static bool linear_handle(data &);
static bool polylog_handle(data &);
static bool longpoll_handle(data &);
static resource::response handle_get(client &, const resource::request &);
}
#include "sync/args.h"

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Account Data"
};
namespace ircd::m::sync
{
static bool account_data_(data &, const m::event &);
@ -23,6 +17,12 @@ namespace ircd::m::sync
extern item account_data;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Account Data"
};
decltype(ircd::m::sync::account_data)
ircd::m::sync::account_data
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Device Lists"
};
namespace ircd::m::sync
{
static bool device_lists_polylog(data &);
@ -22,6 +16,12 @@ namespace ircd::m::sync
extern item device_lists;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Device Lists"
};
decltype(ircd::m::sync::device_lists)
ircd::m::sync::device_lists
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Device One Time Keys Count"
};
namespace ircd::m
{
std::map<std::string, long>
@ -29,6 +23,12 @@ namespace ircd::m::sync
extern item device_one_time_keys_count;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Device One Time Keys Count"
};
decltype(ircd::m::sync::device_one_time_keys_count)
ircd::m::sync::device_one_time_keys_count
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Presence"
};
namespace ircd::m::sync
{
static bool presence_polylog(data &);
@ -22,6 +16,12 @@ namespace ircd::m::sync
extern item presence;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Presence"
};
decltype(ircd::m::sync::presence)
ircd::m::sync::presence
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Rooms"
};
namespace ircd::m::sync
{
static bool should_ignore(const data &);
@ -28,6 +22,12 @@ namespace ircd::m::sync
extern item rooms;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Rooms"
};
decltype(ircd::m::sync::rooms)
ircd::m::sync::rooms
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Account Data"
};
namespace ircd::m::sync
{
static bool room_account_data_polylog_tags(data &);
@ -28,6 +22,12 @@ namespace ircd::m::sync
extern item room_account_data;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Account Data"
};
decltype(ircd::m::sync::room_account_data)
ircd::m::sync::room_account_data
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Rooms Ephemeral"
};
namespace ircd::m::sync
{
static bool rooms_ephemeral_events_polylog(data &);
@ -22,6 +16,12 @@ namespace ircd::m::sync
extern item rooms_ephemeral;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Rooms Ephemeral"
};
decltype(ircd::m::sync::rooms_ephemeral)
ircd::m::sync::rooms_ephemeral
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Ephemeral :Receipts"
};
namespace ircd::m::sync
{
extern conf::item<int64_t> receipt_scan_depth;
@ -25,6 +19,12 @@ namespace ircd::m::sync
extern item room_ephemeral_m_receipt_m_read;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Ephemeral :Receipts"
};
decltype(ircd::m::sync::room_ephemeral_m_receipt_m_read)
ircd::m::sync::room_ephemeral_m_receipt_m_read
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Ephemeral :Typing"
};
namespace ircd::m::sync
{
static bool room_ephemeral_m_typing_polylog(data &);
@ -21,6 +15,12 @@ namespace ircd::m::sync
extern item room_ephemeral_m_typing;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Ephemeral :Typing"
};
decltype(ircd::m::sync::room_ephemeral_m_typing)
ircd::m::sync::room_ephemeral_m_typing
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Summary"
};
namespace ircd::m::sync
{
static bool room_summary_append_counts(data &);
@ -24,6 +18,12 @@ namespace ircd::m::sync
extern item room_summary;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Summary"
};
decltype(ircd::m::sync::room_summary)
ircd::m::sync::room_summary
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Timeline"
};
namespace ircd::m::sync
{
static bool _room_timeline_append(data &, json::stack::array &, const m::event::idx &, const m::event &);
@ -28,6 +22,12 @@ namespace ircd::m::sync
extern item room_timeline;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Timeline"
};
decltype(ircd::m::sync::room_timeline)
ircd::m::sync::room_timeline
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Unread Notifications"
};
namespace ircd::m::sync
{
static long _notification_count(const room &, const event::idx &a, const event::idx &b);
@ -24,6 +18,12 @@ namespace ircd::m::sync
extern item room_unread_notifications;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :Room Unread Notifications"
};
decltype(ircd::m::sync::room_unread_notifications)
ircd::m::sync::room_unread_notifications
{

View file

@ -8,12 +8,6 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :To Device"
};
namespace ircd::m::sync
{
static bool to_device_polylog(data &);
@ -22,6 +16,12 @@ namespace ircd::m::sync
extern item to_device;
}
ircd::mapi::header
IRCD_MODULE
{
"Client Sync :To Device"
};
decltype(ircd::m::sync::to_device)
ircd::m::sync::to_device
{