|
|
|
|
@ -6,6 +6,7 @@
|
|
|
|
|
#include "chat_event.h" |
|
|
|
|
#include "chat_admin.h" |
|
|
|
|
#include "chat_join.h" |
|
|
|
|
#include "group_avatar.h" |
|
|
|
|
#include "../routing_layer/topo_node_sqlite.h" |
|
|
|
|
#include "../routing_layer/topo_group.h" |
|
|
|
|
#include "../routing_layer/topo_group_invite.h" |
|
|
|
|
@ -752,6 +753,9 @@ int chat_sync_init(struct UTUN_INSTANCE* inst) {
|
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member synchronization initialization failed", CS_ID); |
|
|
|
|
inst->chat_sync = NULL; u_free(cs); return -1; |
|
|
|
|
} |
|
|
|
|
if (group_avatar_init(inst) < 0) { |
|
|
|
|
member_sync_destroy(inst); inst->chat_sync = NULL; u_free(cs); return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
etcp_bind(inst, ETCP_RT_ID_CHAT_SYNC, chat_sync_recv_cb); |
|
|
|
|
etcp_add_conn_status_cbk(inst, cs_on_conn_status, cs); |
|
|
|
|
@ -782,6 +786,7 @@ void chat_sync_destroy(struct UTUN_INSTANCE* inst) {
|
|
|
|
|
member_sync_remove_apply_cbk(inst, cs_on_member_applied, cs); |
|
|
|
|
utun_remove_peer_sleep_cbk(inst, cs_on_peer_sleep, cs); |
|
|
|
|
cs_pending_free_all(cs); |
|
|
|
|
group_avatar_destroy(inst); |
|
|
|
|
member_sync_destroy(inst); |
|
|
|
|
chat_admin_destroy(inst); |
|
|
|
|
chat_join_destroy(inst); |
|
|
|
|
|