diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index 04312bd868191d48f1eb535d9604308e84d1bbbc..bfc57bc72b9de3473a6b238771bddf7599286d22 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -119,6 +119,7 @@ sflphone_hung_up( call_t * c) { call_list_remove( current_calls, c->callID); update_call_tree_remove(current_calls, c); + c->state = CALL_STATE_DIALING; update_menus(); status_tray_icon_blink( FALSE ); } @@ -231,6 +232,7 @@ sflphone_hang_up() case CALL_STATE_INCOMING: dbus_refuse (selectedCall); selectedCall->state = CALL_STATE_DIALING; + stop_notification(); break; case CALL_STATE_TRANSFERT: dbus_hang_up (selectedCall); @@ -255,7 +257,10 @@ sflphone_pick_up() sflphone_place_call (selectedCall); break; case CALL_STATE_INCOMING: + selectedCall->history_state = INCOMING; + update_call_tree( history , selectedCall ); dbus_accept (selectedCall); + stop_notification(); break; case CALL_STATE_HOLD: sflphone_new_call(); @@ -510,9 +515,11 @@ sflphone_keypad( guint keyval, gchar * key) c->history_state = INCOMING; update_call_tree( history , c ); dbus_accept(c); + stop_notification(); break; case 65307: /* ESCAPE */ dbus_refuse(c); + stop_notification(); break; } break; diff --git a/sflphone-gtk/src/sflnotify.c b/sflphone-gtk/src/sflnotify.c index 7ff7debd9791ed0a6c7011c2a2cc7d3d71ce3d05..fcfca766d381d13ec5f3fca950c03220e4108972 100644 --- a/sflphone-gtk/src/sflnotify.c +++ b/sflphone-gtk/src/sflnotify.c @@ -60,6 +60,8 @@ notify_incoming_call( call_t* c ) answer_call_cb( NotifyNotification *notification, gpointer data ) { call_t* c = (call_t*)g_object_get_data( G_OBJECT( notification ) , "call" ); + c->history_state = INCOMING; + update_call_tree( history , c ); dbus_accept(c); if( __POPUP_WINDOW ) status_icon_unminimize(); @@ -213,3 +215,13 @@ notify_no_registered_accounts( ) g_print("notify(), failed to send notification\n"); } } + +void +stop_notification( void ) +{ + if(notify_notification_show( notification , NULL)) + { + notify_notification_close( notification , NULL); + g_object_unref( notification ); + } +} diff --git a/sflphone-gtk/src/sflnotify.h b/sflphone-gtk/src/sflnotify.h index 5f3bf3130404bc6fc677d037f63f126a8f94e346..af383396f68ff3b7c910ed2dd6e6bbc1739562a6 100644 --- a/sflphone-gtk/src/sflnotify.h +++ b/sflphone-gtk/src/sflnotify.h @@ -97,4 +97,9 @@ void ignore_call_cb( NotifyNotification *notification, gpointer data ); */ void setup_accounts_cb(NotifyNotification *notification, gpointer data); +/** + * Stop and close the current notification if an action occured before the timeout + */ +void stop_notification( void ); + #endif