Added callback for A/V usage.

This commit is contained in:
irungentoo 2014-02-15 13:10:53 -05:00
parent c44f95eb78
commit 5408e3e553
2 changed files with 17 additions and 0 deletions

View File

@ -718,6 +718,14 @@ void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, in
m->friend_connectionstatuschange = function;
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 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)
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);
}
}

View File

@ -210,6 +210,8 @@ typedef struct Messenger {
void *friend_statuschange_userdata;
void (*friend_connectionstatuschange)(struct Messenger *m, int, uint8_t, void *);
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_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.
*/
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************/