diff --git a/src/core.cpp b/src/core.cpp index 0f3204884..8685aab1e 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -263,6 +263,7 @@ void Core::start() tox_callback_group_invite(tox, onGroupInvite, this); tox_callback_group_message(tox, onGroupMessage, this); tox_callback_group_namelist_change(tox, onGroupNamelistChange, this); + tox_callback_group_action(tox, onGroupAction, this); tox_callback_file_send_request(tox, onFileSendRequestCallback, this); tox_callback_file_control(tox, onFileControlCallback, this); tox_callback_file_data(tox, onFileDataCallback, this); @@ -469,6 +470,12 @@ void Core::onAction(Tox*/* tox*/, int friendId, const uint8_t *cMessage, uint16_ emit static_cast(core)->friendMessageReceived(friendId, CString::toString(cMessage, cMessageSize), true); } +void Core::onGroupAction(Tox*, int groupnumber, int peernumber, const uint8_t *action, uint16_t length, void* _core) +{ + Core* core = static_cast(_core); + emit core->groupMessageReceived(groupnumber, CString::toString(action, length), core->getGroupPeerName(groupnumber, peernumber)); +} + void Core::onGroupInvite(Tox*, int friendnumber, const uint8_t *group_public_key, uint16_t length,void *core) { qDebug() << QString("Core: Group invite by %1").arg(friendnumber); diff --git a/src/core.h b/src/core.h index 8d3821993..15c5c7b82 100644 --- a/src/core.h +++ b/src/core.h @@ -197,6 +197,7 @@ private: static void onUserStatusChanged(Tox* tox, int friendId, uint8_t userstatus, void* core); static void onConnectionStatusChanged(Tox* tox, int friendId, uint8_t status, void* core); static void onAction(Tox* tox, int friendId, const uint8_t* cMessage, uint16_t cMessageSize, void* core); + static void onGroupAction(Tox* tox, int groupnumber, int peernumber, const uint8_t * action, uint16_t length, void* core); static void onGroupInvite(Tox *tox, int friendnumber, const uint8_t *group_public_key, uint16_t length,void *userdata); static void onGroupMessage(Tox *tox, int groupnumber, int friendgroupnumber, const uint8_t * message, uint16_t length, void *userdata); static void onGroupNamelistChange(Tox *tox, int groupnumber, int peernumber, uint8_t change, void *userdata);