From 03734b6bf5f52b6a366a5e9f2444cb1c00a0b165 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Mon, 8 Apr 2013 12:59:42 +0200 Subject: [PATCH] change unread messages picture chnage time for time change --- coreapi/message_storage.c | 1 + coreapi/sal_eXosip2.c | 1 + gtk/chat.c | 11 +++++------ pixmaps/active_chat.png | Bin 3103 -> 3415 bytes 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index 0c41c20d..8ba642b6 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -66,6 +66,7 @@ static void create_chat_message(char **argv, void *data){ for(j=0;j<12;j++) { if(strcmp(tmp2,months[j])==0) ret.tm_mon=j; } + ret.tm_isdst=-1; } new_message->time=argv[5]!=NULL ? mktime(&ret) : time(NULL); new_message->state=atoi(argv[7]); diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 2ea0f9af..b86fc26e 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -1798,6 +1798,7 @@ static void text_received(Sal *sal, eXosip_event_t *ev){ for(j=0;j<12;j++) { if(strcmp(tmp2,months[j])==0) ret.tm_mon=j; } + ret.tm_isdst=-1; }else ms_warning("No date header in SIP MESSAGE, we don't know when it was sent."); content_type= osip_message_get_content_type(ev->request); diff --git a/gtk/chat.c b/gtk/chat.c index cf6d61c9..9bcf0bb8 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -168,10 +168,10 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from, case LinphoneChatMessageStateDelivered: { tnow=time(NULL); - tm=gmtime(&tnow); + tm=localtime(&tnow); tnow_day=tm->tm_yday; tnow_year=tm->tm_year; - tm=gmtime(&t); + tm=localtime(&t); if(tnow_day != tm->tm_yday || (tnow_day == tm->tm_yday && tnow_year != tm->tm_year)) { strftime(buf,80,"%a %x, %H:%M",tm); } else { @@ -237,7 +237,7 @@ void update_chat_state_message(LinphoneChatMessageState state,LinphoneChatMessag case LinphoneChatMessageStateDelivered: { time_t t=time(NULL); - struct tm *tm=gmtime(&t); + struct tm *tm=localtime(&t); char buf[80]; strftime(buf,80,"%H:%M",tm); result=buf; @@ -450,10 +450,10 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, if(w!=NULL){ char *from_chatview=(char *)g_object_get_data(G_OBJECT(friendlist),"from"); if(g_strcmp0(from,from_chatview)==0){ + linphone_chat_room_mark_as_read(room); send=TRUE; } else { if(!linphone_gtk_friend_list_is_contact(linphone_chat_message_get_from(msg))){ - //linphone_gtk_load_chatroom(room,linphone_chat_message_get_from(msg),w); linphone_gtk_chat_add_contact(linphone_chat_message_get_from(msg)); } send=FALSE; @@ -461,7 +461,6 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, } else { send=FALSE; if(!linphone_gtk_friend_list_is_contact(linphone_chat_message_get_from(msg))){ - //linphone_gtk_load_chatroom(room,linphone_chat_message_get_from(msg),w); linphone_gtk_chat_add_contact(linphone_chat_message_get_from(msg)); } w=linphone_gtk_init_chatroom(room,linphone_chat_message_get_from(msg)); @@ -469,6 +468,7 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, g_object_set_data(G_OBJECT(friendlist),"from",from); } get_display_name(linphone_chat_message_get_from(msg)); + #ifdef HAVE_GTK_OSXs /* Notified when a new message is sent */ linphone_gtk_status_icon_set_blinking(TRUE); @@ -491,5 +491,4 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, } else { linphone_gtk_show_friends(); } - //linphone_gtk_update_chat_picture(); } diff --git a/pixmaps/active_chat.png b/pixmaps/active_chat.png index e428845d55648e21ab59ad6c9d94e48b7e8a70ea..d82b7c595c8a90fddb3c313be4bd9c6c524b0af4 100644 GIT binary patch delta 677 zcmV;W0$Tl_7}pxGzY2c>f=NU{RCwCVRbNO`Q5^ox_1e8H-8F<|u7Uc{LqQStVh@I- z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