mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-23 22:28:07 +00:00
implement incoming chat notification on Mac
This commit is contained in:
parent
5792504e34
commit
9e6b473284
3 changed files with 18 additions and 3 deletions
14
gtk/chat.c
14
gtk/chat.c
|
|
@ -19,6 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "linphone.h"
|
||||
|
||||
|
||||
#ifdef HAVE_GTK_OSX
|
||||
#include <gtkosxapplication.h>
|
||||
#endif
|
||||
|
||||
GtkWidget * linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const char *with){
|
||||
GtkWidget *w;
|
||||
GtkTextBuffer *b;
|
||||
|
|
@ -37,6 +42,7 @@ GtkWidget * linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const char *with){
|
|||
}
|
||||
|
||||
void linphone_gtk_create_chatroom(const char *with){
|
||||
|
||||
LinphoneChatRoom *cr=linphone_core_create_chat_room(linphone_gtk_get_core(),with);
|
||||
if (!cr) return;
|
||||
linphone_gtk_init_chatroom(cr,with);
|
||||
|
|
@ -101,9 +107,15 @@ void linphone_gtk_send_text(GtkWidget *button){
|
|||
|
||||
void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message){
|
||||
GtkWidget *w=(GtkWidget*)linphone_chat_room_get_user_data(room);
|
||||
if (w==NULL){
|
||||
if (w==NULL){
|
||||
w=linphone_gtk_init_chatroom(room,linphone_address_as_string_uri_only(from));
|
||||
}
|
||||
|
||||
#ifdef HAVE_GTK_OSX
|
||||
/* Notify when a new message is send */
|
||||
linphone_gtk_status_icon_set_blinking(TRUE);
|
||||
#endif
|
||||
|
||||
linphone_gtk_push_text(GTK_TEXT_VIEW(linphone_gtk_get_widget(w,"textlog")),
|
||||
linphone_address_as_string_uri_only(from),
|
||||
message,FALSE);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ void * linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, c
|
|||
|
||||
void linphone_gtk_show_directory_search(void);
|
||||
|
||||
void linphone_gtk_status_icon_set_blinking(gboolean val);
|
||||
|
||||
/*functions controlling the different views*/
|
||||
gboolean linphone_gtk_use_in_call_view();
|
||||
LinphoneCall *linphone_gtk_get_currently_displayed_call(gboolean *is_conf);
|
||||
|
|
|
|||
|
|
@ -65,10 +65,11 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call
|
|||
static void linphone_gtk_call_encryption_changed(LinphoneCore *lc, LinphoneCall *call, bool_t enabled, const char *token);
|
||||
static void linphone_gtk_transfer_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate);
|
||||
static gboolean linphone_gtk_auto_answer(LinphoneCall *call);
|
||||
static void linphone_gtk_status_icon_set_blinking(gboolean val);
|
||||
void linphone_gtk_status_icon_set_blinking(gboolean val);
|
||||
void _linphone_gtk_enable_video(gboolean val);
|
||||
|
||||
|
||||
|
||||
static gboolean verbose=0;
|
||||
static gboolean auto_answer = 0;
|
||||
static gchar * addr_to_call = NULL;
|
||||
|
|
@ -1347,7 +1348,7 @@ static gboolean do_icon_blink(GtkStatusIcon *gi){
|
|||
|
||||
#endif
|
||||
|
||||
static void linphone_gtk_status_icon_set_blinking(gboolean val){
|
||||
void linphone_gtk_status_icon_set_blinking(gboolean val){
|
||||
#ifdef HAVE_GTK_OSX
|
||||
static gint attention_id;
|
||||
GtkOSXApplication *theMacApp=(GtkOSXApplication*)g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue