1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Compat with toxcore: New groupchats

Text only is supported for now
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-11-11 15:03:08 +01:00
parent faa1a01c33
commit 722aeb776e
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 15 additions and 4 deletions

View File

@ -479,10 +479,21 @@ void Core::onGroupAction(Tox*, int groupnumber, int peernumber, const uint8_t *a
core->getGroupPeerName(groupnumber, peernumber), true);
}
void Core::onGroupInvite(Tox*, int friendnumber, const uint8_t *group_public_key, uint16_t length,void *core)
void Core::onGroupInvite(Tox*, int friendnumber, uint8_t type, const uint8_t *data, uint16_t length,void *core)
{
qDebug() << QString("Core: Group invite by %1").arg(friendnumber);
emit static_cast<Core*>(core)->groupInviteReceived(friendnumber, group_public_key,length);
if (type == TOX_GROUPCHAT_TYPE_TEXT)
{
qDebug() << QString("Core: Text group invite by %1").arg(friendnumber);
emit static_cast<Core*>(core)->groupInviteReceived(friendnumber, data,length);
}
else if (type == TOX_GROUPCHAT_TYPE_AV)
{
qDebug() << QString("Core: AV group invite by %1, not implemented").arg(friendnumber);
}
else
{
qWarning() << "Core: Group invite with unknown type "<<type;
}
}
void Core::onGroupMessage(Tox*, int groupnumber, int peernumber, const uint8_t * message, uint16_t length, void *_core)

View File

@ -207,7 +207,7 @@ private:
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 onGroupInvite(Tox *tox, int friendnumber, uint8_t type, const uint8_t *data, 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);
static void onFileSendRequestCallback(Tox *tox, int32_t friendnumber, uint8_t filenumber, uint64_t filesize,