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

Compat with toxcore

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-09-28 10:56:02 +02:00
parent 35f548c3a1
commit 21d084e258
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
4 changed files with 10 additions and 10 deletions

View File

@ -299,10 +299,10 @@ void Core::onAction(Tox*/* tox*/, int friendId, const uint8_t *cMessage, uint16_
emit static_cast<Core*>(core)->actionReceived(friendId, CString::toString(cMessage, cMessageSize));
}
void Core::onGroupInvite(Tox*, int friendnumber, const uint8_t *group_public_key, void *core)
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);
emit static_cast<Core*>(core)->groupInviteReceived(friendnumber, group_public_key);
emit static_cast<Core*>(core)->groupInviteReceived(friendnumber, group_public_key,length);
}
void Core::onGroupMessage(Tox*, int groupnumber, int friendgroupnumber, const uint8_t * message, uint16_t length, void *core)
@ -1084,10 +1084,10 @@ QList<QString> Core::getGroupPeerNames(int groupId) const
return names;
}
int Core::joinGroupchat(int32_t friendnumber, const uint8_t* friend_group_public_key) const
int Core::joinGroupchat(int32_t friendnumber, const uint8_t* friend_group_public_key,uint16_t length) const
{
qDebug() << QString("Trying to join groupchat invite by friend %1").arg(friendnumber);
return tox_join_groupchat(tox, friendnumber, friend_group_public_key);
return tox_join_groupchat(tox, friendnumber, friend_group_public_key,length);
}
void Core::quitGroupChat(int groupId) const

6
core.h
View File

@ -42,7 +42,7 @@ public:
QString getGroupPeerName(int groupId, int peerId) const;
QList<QString> getGroupPeerNames(int groupId) const;
QString getFriendAddress(int friendNumber) const;
int joinGroupchat(int32_t friendnumber, const uint8_t* friend_group_public_key) const;
int joinGroupchat(int32_t friendnumber, const uint8_t* friend_group_public_key,uint16_t length) const;
void quitGroupChat(int groupId) const;
void dispatchVideoFrame(vpx_image img) const;
@ -119,7 +119,7 @@ signals:
void friendLastSeenChanged(int friendId, const QDateTime& dateTime);
void emptyGroupCreated(int groupnumber);
void groupInviteReceived(int friendnumber, const uint8_t *group_public_key);
void groupInviteReceived(int friendnumber, const uint8_t *group_public_key,uint16_t length);
void groupMessageReceived(int groupnumber, int friendgroupnumber, const QString& message);
void groupNamelistChanged(int groupnumber, int peernumber, uint8_t change);
@ -178,7 +178,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 onGroupInvite(Tox *tox, int friendnumber, const uint8_t *group_public_key, void *userdata);
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);
static void onFileSendRequestCallback(Tox *tox, int32_t friendnumber, uint8_t filenumber, uint64_t filesize,

View File

@ -633,9 +633,9 @@ void Widget::copyFriendIdToClipboard(int friendId)
}
}
void Widget::onGroupInviteReceived(int32_t friendId, const uint8_t* publicKey)
void Widget::onGroupInviteReceived(int32_t friendId, const uint8_t* publicKey,uint16_t length)
{
int groupId = core->joinGroupchat(friendId, publicKey);
int groupId = core->joinGroupchat(friendId, publicKey,length);
if (groupId == -1)
{
qWarning() << "Widget::onGroupInviteReceived: Unable to accept invitation";

View File

@ -98,7 +98,7 @@ private slots:
void onFriendMessageReceived(int friendId, const QString& message);
void onFriendRequestReceived(const QString& userId, const QString& message);
void onEmptyGroupCreated(int groupId);
void onGroupInviteReceived(int32_t friendId, const uint8_t *publicKey);
void onGroupInviteReceived(int32_t friendId, const uint8_t *publicKey,uint16_t length);
void onGroupMessageReceived(int groupnumber, int friendgroupnumber, const QString& message);
void onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t change);
void removeFriend(int friendId);