|
|
|
|
@ -51,12 +51,23 @@ void chat_event_post(struct UTUN_INSTANCE* inst, int type, const uint8_t* data,
|
|
|
|
|
[44]="CALL_CONNECTION", |
|
|
|
|
[45]="DM_CONVERSATIONS", [46]="ATTACHMENT_PREPARATION", [47]="DM_CALL_ROUTE", |
|
|
|
|
[55]="RADIO_MUTE_RESULT", |
|
|
|
|
[56]="MSG_SUBMITTED", |
|
|
|
|
}; |
|
|
|
|
const char* n = (type >= 1 && type < (int)(sizeof(names) / sizeof(names[0]))) ? names[type] : "?"; |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_CHAT, "chat_event: %s(%d) data=%d bytes", n, type, len); |
|
|
|
|
if (data && len > 0) log_dump(DEBUG_LEVEL_DEBUG, DEBUG_CATEGORY_CHAT, " ", data, len); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Идентификатор связывает результат с конкретной отправкой, независимо от текущего канала GUI. */ |
|
|
|
|
void chat_event_submitted(struct UTUN_INSTANCE* inst, uint64_t request_id, int success) { |
|
|
|
|
if (!request_id) return; |
|
|
|
|
uint8_t data[9]; |
|
|
|
|
for (unsigned i = 0; i < 8; i++) data[i] = (uint8_t)(request_id >> (8 * i)); |
|
|
|
|
data[8] = success != 0; |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_CHAT, "message submit result: request=%llu success=%d", (unsigned long long)request_id, success); |
|
|
|
|
chat_event_post(inst, CHAT_EVT_MSG_SUBMITTED, data, sizeof(data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* ID задачи не даёт позднему завершению изменить статус другой подготовки. */ |
|
|
|
|
void chat_event_attachment(struct UTUN_INSTANCE* inst, int is_dm, const char* target, const uint8_t id[16], int state) { |
|
|
|
|
char name[68]; |
|
|
|
|
|