mirror of
https://github.com/matrix-construct/construct
synced 2024-10-01 13:18:58 +02:00
modules/client/sync: Minor cleanup;
modules/client/sync: Consolidate header.
This commit is contained in:
parent
3e694d50cf
commit
5b088551ae
15 changed files with 107 additions and 117 deletions
|
@ -8,7 +8,35 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// 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::mapi::header
|
||||||
IRCD_MODULE
|
IRCD_MODULE
|
||||||
|
|
|
@ -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"
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Account Data"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool account_data_(data &, const m::event &);
|
static bool account_data_(data &, const m::event &);
|
||||||
|
@ -23,6 +17,12 @@ namespace ircd::m::sync
|
||||||
extern item account_data;
|
extern item account_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Account Data"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::account_data)
|
decltype(ircd::m::sync::account_data)
|
||||||
ircd::m::sync::account_data
|
ircd::m::sync::account_data
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Device Lists"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool device_lists_polylog(data &);
|
static bool device_lists_polylog(data &);
|
||||||
|
@ -22,6 +16,12 @@ namespace ircd::m::sync
|
||||||
extern item device_lists;
|
extern item device_lists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Device Lists"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::device_lists)
|
decltype(ircd::m::sync::device_lists)
|
||||||
ircd::m::sync::device_lists
|
ircd::m::sync::device_lists
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// 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
|
namespace ircd::m
|
||||||
{
|
{
|
||||||
std::map<std::string, long>
|
std::map<std::string, long>
|
||||||
|
@ -29,6 +23,12 @@ namespace ircd::m::sync
|
||||||
extern item device_one_time_keys_count;
|
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)
|
decltype(ircd::m::sync::device_one_time_keys_count)
|
||||||
ircd::m::sync::device_one_time_keys_count
|
ircd::m::sync::device_one_time_keys_count
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Presence"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool presence_polylog(data &);
|
static bool presence_polylog(data &);
|
||||||
|
@ -22,6 +16,12 @@ namespace ircd::m::sync
|
||||||
extern item presence;
|
extern item presence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Presence"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::presence)
|
decltype(ircd::m::sync::presence)
|
||||||
ircd::m::sync::presence
|
ircd::m::sync::presence
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Rooms"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool should_ignore(const data &);
|
static bool should_ignore(const data &);
|
||||||
|
@ -28,6 +22,12 @@ namespace ircd::m::sync
|
||||||
extern item rooms;
|
extern item rooms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Rooms"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::rooms)
|
decltype(ircd::m::sync::rooms)
|
||||||
ircd::m::sync::rooms
|
ircd::m::sync::rooms
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// 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
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool room_account_data_polylog_tags(data &);
|
static bool room_account_data_polylog_tags(data &);
|
||||||
|
@ -28,6 +22,12 @@ namespace ircd::m::sync
|
||||||
extern item room_account_data;
|
extern item room_account_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Room Account Data"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::room_account_data)
|
decltype(ircd::m::sync::room_account_data)
|
||||||
ircd::m::sync::room_account_data
|
ircd::m::sync::room_account_data
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Rooms Ephemeral"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool rooms_ephemeral_events_polylog(data &);
|
static bool rooms_ephemeral_events_polylog(data &);
|
||||||
|
@ -22,6 +16,12 @@ namespace ircd::m::sync
|
||||||
extern item rooms_ephemeral;
|
extern item rooms_ephemeral;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Rooms Ephemeral"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::rooms_ephemeral)
|
decltype(ircd::m::sync::rooms_ephemeral)
|
||||||
ircd::m::sync::rooms_ephemeral
|
ircd::m::sync::rooms_ephemeral
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// 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
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
extern conf::item<int64_t> receipt_scan_depth;
|
extern conf::item<int64_t> receipt_scan_depth;
|
||||||
|
@ -25,6 +19,12 @@ namespace ircd::m::sync
|
||||||
extern item room_ephemeral_m_receipt_m_read;
|
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)
|
decltype(ircd::m::sync::room_ephemeral_m_receipt_m_read)
|
||||||
ircd::m::sync::room_ephemeral_m_receipt_m_read
|
ircd::m::sync::room_ephemeral_m_receipt_m_read
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// 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
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool room_ephemeral_m_typing_polylog(data &);
|
static bool room_ephemeral_m_typing_polylog(data &);
|
||||||
|
@ -21,6 +15,12 @@ namespace ircd::m::sync
|
||||||
extern item room_ephemeral_m_typing;
|
extern item room_ephemeral_m_typing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Room Ephemeral :Typing"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::room_ephemeral_m_typing)
|
decltype(ircd::m::sync::room_ephemeral_m_typing)
|
||||||
ircd::m::sync::room_ephemeral_m_typing
|
ircd::m::sync::room_ephemeral_m_typing
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Room Summary"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool room_summary_append_counts(data &);
|
static bool room_summary_append_counts(data &);
|
||||||
|
@ -24,6 +18,12 @@ namespace ircd::m::sync
|
||||||
extern item room_summary;
|
extern item room_summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Room Summary"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::room_summary)
|
decltype(ircd::m::sync::room_summary)
|
||||||
ircd::m::sync::room_summary
|
ircd::m::sync::room_summary
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :Room Timeline"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool _room_timeline_append(data &, json::stack::array &, const m::event::idx &, const m::event &);
|
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;
|
extern item room_timeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Room Timeline"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::room_timeline)
|
decltype(ircd::m::sync::room_timeline)
|
||||||
ircd::m::sync::room_timeline
|
ircd::m::sync::room_timeline
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// 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
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static long _notification_count(const room &, const event::idx &a, const event::idx &b);
|
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;
|
extern item room_unread_notifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :Room Unread Notifications"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::room_unread_notifications)
|
decltype(ircd::m::sync::room_unread_notifications)
|
||||||
ircd::m::sync::room_unread_notifications
|
ircd::m::sync::room_unread_notifications
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,6 @@
|
||||||
// copyright notice and this permission notice is present in all copies. The
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
ircd::mapi::header
|
|
||||||
IRCD_MODULE
|
|
||||||
{
|
|
||||||
"Client Sync :To Device"
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool to_device_polylog(data &);
|
static bool to_device_polylog(data &);
|
||||||
|
@ -22,6 +16,12 @@ namespace ircd::m::sync
|
||||||
extern item to_device;
|
extern item to_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Client Sync :To Device"
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::to_device)
|
decltype(ircd::m::sync::to_device)
|
||||||
ircd::m::sync::to_device
|
ircd::m::sync::to_device
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue