minor additions

This commit is contained in:
Green Sky 2023-07-21 12:56:12 +02:00
parent 9e3295b19c
commit cac82821e8
No known key found for this signature in database
2 changed files with 10 additions and 4 deletions

View File

@ -545,8 +545,8 @@ std::vector<uint32_t> ToxDefaultImpl::toxGroupGetList(void) {
std::tuple<std::optional<uint32_t>, Tox_Err_Group_Send_Message> ToxDefaultImpl::toxGroupSendMessage(uint32_t group_number, Tox_Message_Type type, std::string_view message) {
Tox_Err_Group_Send_Message err = TOX_ERR_GROUP_SEND_MESSAGE_OK;
uint32_t message_id = 0;
tox_group_send_message(_tox, group_number, type, reinterpret_cast<const uint8_t*>(message.data()), message.size(), &message_id, &err);
if (err == TOX_ERR_GROUP_SEND_MESSAGE_OK) {
const bool res = tox_group_send_message(_tox, group_number, type, reinterpret_cast<const uint8_t*>(message.data()), message.size(), &message_id, &err);
if (res) {
return {message_id, err};
} else {
return {std::nullopt, err};

View File

@ -40,8 +40,14 @@ bool ToxEventLogger::onToxEvent(const Tox_Event_File_Chunk_Request* e) {
return false;
}
bool ToxEventLogger::onToxEvent(const Tox_Event_File_Recv*) {
_out << "TOX_EVENT: " << tox_event_to_string(TOX_EVENT_FILE_RECV) << "\n";
bool ToxEventLogger::onToxEvent(const Tox_Event_File_Recv* e) {
_out << "TOX_EVENT: " << tox_event_to_string(TOX_EVENT_FILE_RECV)
<< " frd:" << tox_event_file_recv_get_friend_number(e)
<< " fnb:" << tox_event_file_recv_get_file_number(e)
<< " fnm:" << std::string_view{reinterpret_cast<const char*>(tox_event_file_recv_get_filename(e)), tox_event_file_recv_get_filename_length(e)}
<< " sze:" << tox_event_file_recv_get_file_size(e)
<< " knd:" << tox_event_file_recv_get_kind(e)
<< "\n";
return false;
}