summaryrefslogtreecommitdiff
path: root/toxav/msi.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/msi.c')
-rwxr-xr-xtoxav/msi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/toxav/msi.c b/toxav/msi.c
index 4bae076f..978989ce 100755
--- a/toxav/msi.c
+++ b/toxav/msi.c
@@ -117,7 +117,7 @@ typedef struct _MSIMessage {
117static struct _Callbacks { 117static struct _Callbacks {
118 MSICallback function; 118 MSICallback function;
119 void* data; 119 void* data;
120} callbacks[10] = {0}; 120} callbacks[11] = {0};
121 121
122inline__ void invoke_callback(MSICallbackID id) 122inline__ void invoke_callback(MSICallbackID id)
123{ 123{
@@ -653,7 +653,8 @@ void handle_remote_connection_change(Messenger *messenger, int friend_num, uint8
653 653
654 for ( ; i < session->call->peer_count; i ++ ) 654 for ( ; i < session->call->peer_count; i ++ )
655 if ( session->call->peers[i] == friend_num ) { 655 if ( session->call->peers[i] == friend_num ) {
656 msi_stopcall(session); /* Stop the call for now */ 656 invoke_callback(MSI_OnPeerTimeout);
657 /*msi_stopcall(session); /* Stop the call for now */
657 return; 658 return;
658 } 659 }
659 } 660 }
@@ -747,10 +748,9 @@ void *handle_timeout ( void *arg )
747 748
748 } 749 }
749 750
750 return NULL; 751 pthread_exit(NULL);
751} 752}
752 753
753
754/** 754/**
755 * @brief Add peer to peer list. 755 * @brief Add peer to peer list.
756 * 756 *
@@ -1244,13 +1244,12 @@ int msi_terminate_session ( MSISession *session )
1244 assert ( session ); 1244 assert ( session );
1245 1245
1246 int _status = 0; 1246 int _status = 0;
1247 1247
1248 terminate_call ( session ); 1248 /* If have call, cancel it */
1249 if ( session->call ) msi_cancel(session, 0, "MSI session terminated!");
1250
1249 m_callback_msi_packet((struct Messenger *) session->messenger_handle, NULL, NULL); 1251 m_callback_msi_packet((struct Messenger *) session->messenger_handle, NULL, NULL);
1250 1252
1251
1252 /* TODO: Clean it up more? */
1253
1254 free ( session ); 1253 free ( session );
1255 return _status; 1254 return _status;
1256} 1255}