summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-03-05 16:06:56 +0000
committerCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-03-12 14:07:50 +0100
commit5f8cebc439597e30eb6fc0f315770a6d5f2d1a8a (patch)
tree4de27c16cbb97156da335cc04c4c380831a558a9
parent4e260679680fff96fbbb821de5752476acd45c79 (diff)
downloadtelepathy-logger-5f8cebc439597e30eb6fc0f315770a6d5f2d1a8a.tar.gz
Using gint instead of gint64 pending messages ID for TplLogEntry
TplLogEntry P.M.ID cannot be unsigned since it needs a way to recognized ACK'd messages and other special values
-rw-r--r--telepathy-logger/channel-text.c2
-rw-r--r--telepathy-logger/log-entry.c14
-rw-r--r--telepathy-logger/log-entry.h8
-rw-r--r--telepathy-logger/log-store-empathy.c2
4 files changed, 14 insertions, 12 deletions
diff --git a/telepathy-logger/channel-text.c b/telepathy-logger/channel-text.c
index 331072a..0b329f1 100644
--- a/telepathy-logger/channel-text.c
+++ b/telepathy-logger/channel-text.c
@@ -971,7 +971,7 @@ on_pending_messages_removed_cb (TpChannel *proxy,
PATH_DEBUG (proxy, "msg_id %d acknowledged", msg_id);
if (error != NULL)
{
- PATH_DEBUG (proxy, "cannot set the ACK flag for msg_id %d: %s",
+ PATH_DEBUG (proxy, "cannot set the ACK flag for msg_id %u: %s",
msg_id, error->message);
g_clear_error (&error);
}
diff --git a/telepathy-logger/log-entry.c b/telepathy-logger/log-entry.c
index 3b51464..bffcaa1 100644
--- a/telepathy-logger/log-entry.c
+++ b/telepathy-logger/log-entry.c
@@ -56,7 +56,9 @@ struct _TplLogEntryPriv
gchar *chat_id;
gchar *account_path;
gchar *channel_path;
- gint64 pending_msg_id;
+ /* in specs it's guint, TplLogEntry needs a way to represent ACK'd messages:
+ * if pending_msg_id reachs G_MAXINT32, then the problem is elsewhere :-) */
+ gint pending_msg_id;
/* incoming/outgoing */
TplLogEntryDirection direction;
@@ -133,7 +135,7 @@ tpl_log_entry_get_property (GObject *object,
g_value_set_uint (value, priv->signal_type);
break;
case PROP_PENDING_MSG_ID:
- g_value_set_uint (value, priv->pending_msg_id);
+ g_value_set_int (value, priv->pending_msg_id);
break;
case PROP_LOG_ID:
g_value_set_string (value, priv->log_id);
@@ -179,7 +181,7 @@ tpl_log_entry_set_property (GObject *object,
tpl_log_entry_set_signal_type (self, g_value_get_uint (value));
break;
case PROP_PENDING_MSG_ID:
- tpl_log_entry_set_pending_msg_id (self, g_value_get_uint (value));
+ tpl_log_entry_set_pending_msg_id (self, g_value_get_int (value));
break;
case PROP_LOG_ID:
tpl_log_entry_set_log_id (self, g_value_get_string (value));
@@ -266,7 +268,7 @@ tpl_log_entry_class_init (TplLogEntryClass *klass)
* The couple (channel-path, pending-msg-id) cannot be considered unique.
* Use #TplLogEntry::log-id for a TPL-unique identifier.
*/
- param_spec = g_param_spec_int64 ("pending-msg-id",
+ param_spec = g_param_spec_int ("pending-msg-id",
"PendingMessageId",
"Pending Message ID, if set, the log entry is set as pending for ACK."
" Default to -1 meaning not pending.",
@@ -352,7 +354,7 @@ tpl_log_entry_get_timestamp (TplLogEntry *self)
}
-gint64
+gint
tpl_log_entry_get_pending_msg_id (TplLogEntry *self)
{
TplLogEntryPriv *priv = GET_PRIV (self);
@@ -505,7 +507,7 @@ tpl_log_entry_set_signal_type (TplLogEntry *self,
*/
void
tpl_log_entry_set_pending_msg_id (TplLogEntry *self,
- gint64 data)
+ gint data)
{
TplLogEntryPriv *priv = GET_PRIV (self);
diff --git a/telepathy-logger/log-entry.h b/telepathy-logger/log-entry.h
index 9a4f5b7..bd54114 100644
--- a/telepathy-logger/log-entry.h
+++ b/telepathy-logger/log-entry.h
@@ -83,7 +83,7 @@ typedef struct
void (*finalize) (GObject *obj);
gint64 (*get_timestamp) (TplLogEntry *self);
- gint64 (*get_pending_msg_id) (TplLogEntry *self);
+ gint (*get_pending_msg_id) (TplLogEntry *self);
gboolean (*is_pending) (TplLogEntry *self);
TplLogEntrySignalType (*get_signal_type) (TplLogEntry *self);
const gchar* (*get_log_id) (TplLogEntry *self);
@@ -95,7 +95,7 @@ typedef struct
const gchar * (*get_channel_path) (TplLogEntry *self);
void (*set_timestamp) (TplLogEntry *self, gint64 data);
- void (*set_pending_msg_id) (TplLogEntry *self, gint64 data);
+ void (*set_pending_msg_id) (TplLogEntry *self, gint data);
void (*set_signal_type) (TplLogEntry *self, TplLogEntrySignalType data);
void (*set_log_id) (TplLogEntry *self, guint data);
void (*set_direction) (TplLogEntry *self, TplLogEntryDirection data);
@@ -110,7 +110,7 @@ typedef struct
GType tpl_log_entry_get_type (void);
gint64 tpl_log_entry_get_timestamp (TplLogEntry *self);
-gint64 tpl_log_entry_get_pending_msg_id (TplLogEntry *self);
+gint tpl_log_entry_get_pending_msg_id (TplLogEntry *self);
gboolean tpl_log_entry_is_pending (TplLogEntry *self);
TplLogEntrySignalType tpl_log_entry_get_signal_type (TplLogEntry *self);
const gchar* tpl_log_entry_get_log_id (TplLogEntry *self);
@@ -123,7 +123,7 @@ TplContact *tpl_log_entry_get_sender (TplLogEntry *self);
TplContact *tpl_log_entry_get_receiver (TplLogEntry *self);
void tpl_log_entry_set_timestamp (TplLogEntry *self, gint64 data);
-void tpl_log_entry_set_pending_msg_id (TplLogEntry *self, gint64 data);
+void tpl_log_entry_set_pending_msg_id (TplLogEntry *self, gint data);
void tpl_log_entry_set_signal_type (TplLogEntry *self,
TplLogEntrySignalType data);
void tpl_log_entry_set_direction (TplLogEntry *self,
diff --git a/telepathy-logger/log-store-empathy.c b/telepathy-logger/log-store-empathy.c
index 775e3f1..d727a96 100644
--- a/telepathy-logger/log-store-empathy.c
+++ b/telepathy-logger/log-store-empathy.c
@@ -512,7 +512,7 @@ log_store_empathy_get_messages_for_file (TplLogStore *self,
gboolean is_user = FALSE;
gchar *msg_type_str;
gchar *cm_id_str;
- gint64 cm_id;
+ gint cm_id;
gchar *instead_of_channel_path;
gchar *log_id;
TpChannelTextMessageType msg_type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL;