diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 3b929ee5f9a207ab69ac20b1d02fc0a51f408b27..54a801752efdb238d0727659fd4772651b5fcb5d 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1349,10 +1349,12 @@ void sflphone_save_history (void) if (current) { if(current->type == HIST_CALL) { + DEBUG("Serialize call"); value = serialize_history_call_entry (current->elem.call); key = convert_timestamp_to_gchar (current->elem.call->_time_start); } else if(current->type == HIST_CONFERENCE) { + DEBUG("Serialize conference"); value = serialize_history_conference_entry(current->elem.conf); key = convert_timestamp_to_gchar (current->elem.conf->_time_start); } diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index 0daae8b912839625457fcc942af6392cc0a3a815..401dbe4c41d81a01da887f21bf9f0cf91aca7045 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -32,15 +32,15 @@ #include <sflphone_const.h> #include <time.h> -gint is_confID_confstruct (gconstpointer a, gconstpointer b) +static void set_conference_timestamp (time_t *); + +static void set_conference_timestamp (time_t *timestamp) { - conference_obj_t * c = (conference_obj_t*) a; + time_t tmp; - if (g_strcasecmp (c->_confID, (const gchar*) b) == 0) { - return 0; - } else { - return 1; - } + // Set to current value + (void) time(&tmp); + *timestamp = tmp; } void create_new_conference (conference_state_t state, const gchar* confID, conference_obj_t ** conf) @@ -173,5 +173,39 @@ void conference_participant_list_update (gchar** participants, conference_obj_t* gchar *serialize_history_conference_entry(conference_obj_t *entry) { + gchar *result; + gchar *separator = "|"; + gchar *sep; + gchar *timestamp; + gchar *peer_name; + gchar *numberstr = ""; + GSList *number_list; + gint length = 0; + gint i; + + timestamp = convert_timestamp_to_gchar(entry->_time_stop); + + peer_name = (entry->_confID == NULL || g_strcasecmp(entry->_confID, "") == 0) ? "empty": entry->_confID; + + length = g_slist_length(entry->participant_number); + number_list = entry->participant_number; + + for(i = 0; i < length; i++) { + gchar *tmp = g_slist_nth_data(number_list, i); + if(tmp == NULL) { + WARN("Conference: Peer number is NULL in conference list"); + } + g_strconcat(numberstr, tmp, ","); + } + + result = g_strconcat("2188", separator, + numberstr, separator, // peer number + peer_name, separator, + timestamp, separator, + "", separator, // peer AccountID + entry->_recordfile ? entry->_recordfile : "", + NULL); + + return ""; } diff --git a/sflphone-client-gnome/src/conference_obj.h b/sflphone-client-gnome/src/conference_obj.h index 01514c19d05457638324dfea009e18aeba956c96..9acbc4cb77648ffa9ba5545dd4223fd660fb5032 100644 --- a/sflphone-client-gnome/src/conference_obj.h +++ b/sflphone-client-gnome/src/conference_obj.h @@ -67,6 +67,7 @@ typedef struct { time_t _time_start; time_t _time_stop; time_t _time_current; + gchar *_recordfile; } conference_obj_t; void create_new_conference (conference_state_t, const gchar*, conference_obj_t **); @@ -75,11 +76,6 @@ void create_new_conference_from_details (const gchar *, GHashTable *, conference void free_conference_obj_t (conference_obj_t *c); -/* - * GCompareFunc to compare a confID (gchar* and a callable_obj_t) - */ -gint is_confID_confstruct (gconstpointer, gconstpointer); - void conference_add_participatn (const gchar*, conference_obj_t *); void conference_remove_participant (const gchar*, conference_obj_t *); diff --git a/sflphone-client-gnome/src/contacts/conferencelist.c b/sflphone-client-gnome/src/contacts/conferencelist.c index 9c0744e2a3f6002de1fb85b3967bb7392d9495da..6cba64c070b6595ad3edc201f8402ea1e8381d84 100644 --- a/sflphone-client-gnome/src/contacts/conferencelist.c +++ b/sflphone-client-gnome/src/contacts/conferencelist.c @@ -30,6 +30,19 @@ #include <conferencelist.h> +static gint is_confID_confstruct(gconstpointer, gconstpointer); + +static +gint is_confID_confstruct (gconstpointer a, gconstpointer b) +{ + conference_obj_t * c = (conference_obj_t*) a; + + if (g_strcasecmp (c->_confID, (const gchar*) b) == 0) { + return 0; + } else { + return 1; + } +} gchar* generate_conf_id (void)