mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Added callback for A/V usage.
This commit is contained in:
parent
c44f95eb78
commit
5408e3e553
|
@ -718,6 +718,14 @@ void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, in
|
||||||
m->friend_connectionstatuschange = function;
|
m->friend_connectionstatuschange = function;
|
||||||
m->friend_connectionstatuschange_userdata = userdata;
|
m->friend_connectionstatuschange_userdata = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void m_callback_connectionstatus_internal_av(Messenger *m, void (*function)(Messenger *m, int, uint8_t, void *),
|
||||||
|
void *userdata)
|
||||||
|
{
|
||||||
|
m->friend_connectionstatuschange_internal = function;
|
||||||
|
m->friend_connectionstatuschange_internal_userdata = userdata;
|
||||||
|
}
|
||||||
|
|
||||||
static void break_files(Messenger *m, int friendnumber);
|
static void break_files(Messenger *m, int friendnumber);
|
||||||
static void check_friend_connectionstatus(Messenger *m, int friendnumber, uint8_t status)
|
static void check_friend_connectionstatus(Messenger *m, int friendnumber, uint8_t status)
|
||||||
{
|
{
|
||||||
|
@ -739,6 +747,10 @@ static void check_friend_connectionstatus(Messenger *m, int friendnumber, uint8_
|
||||||
|
|
||||||
if (m->friend_connectionstatuschange)
|
if (m->friend_connectionstatuschange)
|
||||||
m->friend_connectionstatuschange(m, friendnumber, is_online, m->friend_connectionstatuschange_userdata);
|
m->friend_connectionstatuschange(m, friendnumber, is_online, m->friend_connectionstatuschange_userdata);
|
||||||
|
|
||||||
|
if (m->friend_connectionstatuschange_internal)
|
||||||
|
m->friend_connectionstatuschange_internal(m, friendnumber, is_online,
|
||||||
|
m->friend_connectionstatuschange_internal_userdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,8 @@ typedef struct Messenger {
|
||||||
void *friend_statuschange_userdata;
|
void *friend_statuschange_userdata;
|
||||||
void (*friend_connectionstatuschange)(struct Messenger *m, int, uint8_t, void *);
|
void (*friend_connectionstatuschange)(struct Messenger *m, int, uint8_t, void *);
|
||||||
void *friend_connectionstatuschange_userdata;
|
void *friend_connectionstatuschange_userdata;
|
||||||
|
void (*friend_connectionstatuschange_internal)(struct Messenger *m, int, uint8_t, void *);
|
||||||
|
void *friend_connectionstatuschange_internal_userdata;
|
||||||
|
|
||||||
void (*group_invite)(struct Messenger *m, int, uint8_t *, void *);
|
void (*group_invite)(struct Messenger *m, int, uint8_t *, void *);
|
||||||
void *group_invite_userdata;
|
void *group_invite_userdata;
|
||||||
|
@ -460,6 +462,9 @@ void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, int, u
|
||||||
* It's assumed that when adding friends, their connection status is offline.
|
* It's assumed that when adding friends, their connection status is offline.
|
||||||
*/
|
*/
|
||||||
void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, int, uint8_t, void *), void *userdata);
|
void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, int, uint8_t, void *), void *userdata);
|
||||||
|
/* Same as previous but for internal A/V core usage only */
|
||||||
|
void m_callback_connectionstatus_internal_av(Messenger *m, void (*function)(Messenger *m, int, uint8_t, void *),
|
||||||
|
void *userdata);
|
||||||
|
|
||||||
/**********GROUP CHATS************/
|
/**********GROUP CHATS************/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user