mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Fix bug 0002636: Don't know who sent a chat message from a notification.
This commit is contained in:
parent
93972b5874
commit
c3e3178942
3 changed files with 15 additions and 10 deletions
|
|
@ -620,7 +620,7 @@ void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room,
|
|||
#else
|
||||
if ( !gtk_window_is_active ( GTK_WINDOW ( main_window ) ) ) {
|
||||
if ( !GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( w ),"is_notified" ) ) ) {
|
||||
linphone_gtk_notify ( NULL,linphone_chat_message_get_text ( msg ) );
|
||||
linphone_gtk_notify ( NULL, msg, NULL );
|
||||
g_object_set_data ( G_OBJECT ( w ),"is_notified",GINT_TO_POINTER ( TRUE ) );
|
||||
} else {
|
||||
g_object_set_data ( G_OBJECT ( w ),"is_notified",GINT_TO_POINTER ( FALSE ) );
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ LINPHONE_PUBLIC void linphone_gtk_terminate_call(GtkWidget *button);
|
|||
LINPHONE_PUBLIC void linphone_gtk_call_update_tab_header(LinphoneCall *call, gboolean pause);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_directory_search(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_status_icon_set_blinking(gboolean val);
|
||||
LINPHONE_PUBLIC void linphone_gtk_notify(LinphoneCall *call, const char *msg);
|
||||
LINPHONE_PUBLIC void linphone_gtk_notify(LinphoneCall *call, LinphoneChatMessage *chat_message, const char *msg);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_load_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *uri, GtkWidget *chat_view);
|
||||
LINPHONE_PUBLIC void linphone_gtk_send_text();
|
||||
|
|
|
|||
21
gtk/main.c
21
gtk/main.c
|
|
@ -1220,21 +1220,26 @@ static void make_notification(const char *title, const char *body){
|
|||
|
||||
#endif
|
||||
|
||||
void linphone_gtk_notify(LinphoneCall *call, const char *msg){
|
||||
void linphone_gtk_notify(LinphoneCall *call, LinphoneChatMessage *chat_message, const char *msg){
|
||||
#ifdef HAVE_NOTIFY
|
||||
if (!notify_is_initted())
|
||||
if (!notify_init ("Linphone")) ms_error("Libnotify failed to init.");
|
||||
#endif
|
||||
if (!call) {
|
||||
|
||||
if (chat_message) {
|
||||
const LinphoneAddress *address = linphone_chat_message_get_peer_address(chat_message);
|
||||
char *remote = linphone_address_as_string(address);
|
||||
make_notification(remote, linphone_chat_message_get_text(chat_message));
|
||||
} else {
|
||||
#ifdef HAVE_NOTIFY
|
||||
if (!notify_notification_show(notify_notification_new("Linphone",msg,NULL
|
||||
if (!notify_notification_show(notify_notification_new("Linphone",msg,NULL
|
||||
#ifdef HAVE_NOTIFY1
|
||||
,NULL
|
||||
,NULL
|
||||
#endif
|
||||
),NULL))
|
||||
|
||||
),NULL)) {
|
||||
ms_error("Failed to send notification.");
|
||||
}
|
||||
}
|
||||
#else
|
||||
linphone_gtk_show_main_window();
|
||||
#endif
|
||||
|
|
@ -1389,7 +1394,7 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call
|
|||
default:
|
||||
break;
|
||||
}
|
||||
linphone_gtk_notify(call, msg);
|
||||
linphone_gtk_notify(call, NULL, msg);
|
||||
linphone_gtk_update_call_buttons (call);
|
||||
}
|
||||
|
||||
|
|
@ -1952,7 +1957,7 @@ void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to){
|
|||
GtkEntry * uri_bar =GTK_ENTRY(linphone_gtk_get_widget(
|
||||
linphone_gtk_get_main_window(), "uribar"));
|
||||
char *text;
|
||||
linphone_gtk_notify(NULL,(text=ms_strdup_printf(_("We are transferred to %s"),refer_to)));
|
||||
linphone_gtk_notify(NULL,NULL,(text=ms_strdup_printf(_("We are transferred to %s"),refer_to)));
|
||||
g_free(text);
|
||||
gtk_entry_set_text(uri_bar, refer_to);
|
||||
linphone_gtk_start_call(linphone_gtk_get_main_window());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue