Start and stop attachment key owner with chat service
This commit is contained in:
1 parent
60e040677b
commit
e5a1fc5a48
4 files changed
+19
No files matched your search
@@ -124,6 +124,10 @@ utun_CORE_SOURCES = \
|
|||||||
member_files/worker.h \
|
member_files/worker.h \
|
||||||
media_async/media_async.c \
|
media_async/media_async.c \
|
||||||
media_async/attachment.c \
|
media_async/attachment.c \
|
||||||
|
media_async/media_crypto.c \
|
||||||
|
media_async/media_crypto.h \
|
||||||
|
media_async/encrypted_file.c \
|
||||||
|
media_async/encrypted_file.h \
|
||||||
media_async/attachment.h \
|
media_async/attachment.h \
|
||||||
media_async/voice_file.c \
|
media_async/voice_file.c \
|
||||||
media_async/voice_file.h \
|
media_async/voice_file.h \
|
||||||
@@ -152,6 +156,8 @@ utun_CORE_SOURCES = \
|
|||||||
chat/chat_event.c \
|
chat/chat_event.c \
|
||||||
chat/chat_setting.c \
|
chat/chat_setting.c \
|
||||||
chat/chat_core.c \
|
chat/chat_core.c \
|
||||||
|
chat/chat_attachment.c \
|
||||||
|
chat/chat_attachment.h \
|
||||||
chat/chat_member.c \
|
chat/chat_member.c \
|
||||||
chat/chat_msg.c \
|
chat/chat_msg.c \
|
||||||
chat/chat_feedback.c \
|
chat/chat_feedback.c \
|
||||||
@@ -292,6 +298,10 @@ libutun_a_SOURCES = \
|
|||||||
member_files/worker.h \
|
member_files/worker.h \
|
||||||
media_async/media_async.c \
|
media_async/media_async.c \
|
||||||
media_async/attachment.c \
|
media_async/attachment.c \
|
||||||
|
media_async/media_crypto.c \
|
||||||
|
media_async/media_crypto.h \
|
||||||
|
media_async/encrypted_file.c \
|
||||||
|
media_async/encrypted_file.h \
|
||||||
media_async/attachment.h \
|
media_async/attachment.h \
|
||||||
media_async/voice_file.c \
|
media_async/voice_file.c \
|
||||||
media_async/voice_file.h \
|
media_async/voice_file.h \
|
||||||
@@ -320,6 +330,8 @@ libutun_a_SOURCES = \
|
|||||||
chat/chat_event.c \
|
chat/chat_event.c \
|
||||||
chat/chat_setting.c \
|
chat/chat_setting.c \
|
||||||
chat/chat_core.c \
|
chat/chat_core.c \
|
||||||
|
chat/chat_attachment.c \
|
||||||
|
chat/chat_attachment.h \
|
||||||
chat/chat_member.c \
|
chat/chat_member.c \
|
||||||
chat/chat_msg.c \
|
chat/chat_msg.c \
|
||||||
chat/chat_feedback.c \
|
chat/chat_feedback.c \
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "chat_core_priv.h"
|
#include "chat_core_priv.h"
|
||||||
|
#include "chat_attachment.h"
|
||||||
#include "group_avatar.h"
|
#include "group_avatar.h"
|
||||||
#include "chat_event.h"
|
#include "chat_event.h"
|
||||||
#include "chat_feedback.h"
|
#include "chat_feedback.h"
|
||||||
@@ -346,6 +347,7 @@ void chat_core_delete_channel(struct UTUN_INSTANCE* inst, const char* ch_id) {
|
|||||||
|
|
||||||
/* 1. отмена медиа-загрузок/релэев/суперузлов канала (держат conn_mgr handle группы) */
|
/* 1. отмена медиа-загрузок/релэев/суперузлов канала (держат conn_mgr handle группы) */
|
||||||
media_delivery_cancel_channel(inst, gid);
|
media_delivery_cancel_channel(inst, gid);
|
||||||
|
chat_attachment_delete_channel(inst, ch_id);
|
||||||
member_files_cancel_group(inst, gid);
|
member_files_cancel_group(inst, gid);
|
||||||
group_avatar_cancel_group(inst, gid);
|
group_avatar_cancel_group(inst, gid);
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "chat_core_priv.h"
|
#include "chat_core_priv.h"
|
||||||
|
#include "chat_attachment.h"
|
||||||
#include "group_avatar.h"
|
#include "group_avatar.h"
|
||||||
#include "chat_event.h"
|
#include "chat_event.h"
|
||||||
#include "chat_setting.h"
|
#include "chat_setting.h"
|
||||||
@@ -244,6 +245,7 @@ void chat_core_destroy(struct UTUN_INSTANCE* inst) {
|
|||||||
struct chat_core_ctx* cc = CC(inst);
|
struct chat_core_ctx* cc = CC(inst);
|
||||||
if (!cc || !cc->initialized) return;
|
if (!cc || !cc->initialized) return;
|
||||||
cc->initialized = 0;
|
cc->initialized = 0;
|
||||||
|
chat_attachment_destroy(inst);
|
||||||
member_sync_destroy(inst); /* Also releases callback lists after partial startup. */
|
member_sync_destroy(inst); /* Also releases callback lists after partial startup. */
|
||||||
|
|
||||||
if (cc->db && !cc->shared_db) { sqlite3_close(cc->db); }
|
if (cc->db && !cc->shared_db) { sqlite3_close(cc->db); }
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "conn_mgr.h"
|
#include "conn_mgr.h"
|
||||||
#include "chat/db_sync.h"
|
#include "chat/db_sync.h"
|
||||||
#include "chat/chat_core.h"
|
#include "chat/chat_core.h"
|
||||||
|
#include "chat/chat_attachment.h"
|
||||||
#include "chat/chat_sync.h"
|
#include "chat/chat_sync.h"
|
||||||
#include "chat/chat_headless_control.h"
|
#include "chat/chat_headless_control.h"
|
||||||
#include "dm/dm_core.h"
|
#include "dm/dm_core.h"
|
||||||
@@ -791,6 +792,7 @@ int chat_service_start(struct UTUN_INSTANCE* instance) {
|
|||||||
if (chat_core_init(instance, db_file) < 0 || chat_sync_init(instance) < 0 || stream_service_init(instance) < 0) goto fail;
|
if (chat_core_init(instance, db_file) < 0 || chat_sync_init(instance) < 0 || stream_service_init(instance) < 0) goto fail;
|
||||||
instance->media_async = media_async_create();
|
instance->media_async = media_async_create();
|
||||||
if (!instance->media_async || media_delivery_init(instance) < 0) goto fail;
|
if (!instance->media_async || media_delivery_init(instance) < 0) goto fail;
|
||||||
|
if (chat_attachment_init(instance) < 0) goto fail;
|
||||||
if (member_files_init(instance) < 0 || dm_mailbox_init(instance) < 0 || dm_core_init(instance) < 0 ||
|
if (member_files_init(instance) < 0 || dm_mailbox_init(instance) < 0 || dm_core_init(instance) < 0 ||
|
||||||
dm_media_init(instance) < 0 || call_init(instance) < 0) goto fail;
|
dm_media_init(instance) < 0 || call_init(instance) < 0) goto fail;
|
||||||
chat_media_backfill(instance);
|
chat_media_backfill(instance);
|
||||||
@@ -853,6 +855,7 @@ void chat_service_stop(struct UTUN_INSTANCE* instance) {
|
|||||||
stream_service_destroy(instance);
|
stream_service_destroy(instance);
|
||||||
chat_media_startup_backfill_destroy(instance);
|
chat_media_startup_backfill_destroy(instance);
|
||||||
dm_media_quiesce(instance);
|
dm_media_quiesce(instance);
|
||||||
|
chat_attachment_quiesce(instance);
|
||||||
member_files_quiesce(instance);
|
member_files_quiesce(instance);
|
||||||
media_async_destroy(instance->media_async); instance->media_async = NULL;
|
media_async_destroy(instance->media_async); instance->media_async = NULL;
|
||||||
member_files_destroy(instance);
|
member_files_destroy(instance);
|
||||||
|
|||||||
Reference in new issue
Block a user