aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2012-11-25 20:43:52 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2012-11-25 20:43:52 +0000
commitf97b8e9637acba704e976dff79436a83c0f9c63a (patch)
treea7852ec05623e31d62672e942aa5e6c6304ae5c8
parent3592b95ac23e243425e20ff9f69f407cb5ec4a74 (diff)
Use hex for show_ids, but stick to the 2-char maximum. a 256-message backlog
really should be enough.
-rw-r--r--protocols/twitter/twitter.c4
-rw-r--r--protocols/twitter/twitter.h2
-rw-r--r--protocols/twitter/twitter_lib.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index ad75c886..fdfc83ec 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -557,13 +557,13 @@ static guint64 twitter_message_id_from_command_arg(struct im_connection *ic, str
bee_user_t *bu;
guint64 id = 0;
if (g_str_has_prefix(arg, "#") &&
- sscanf(arg + 1, "%" G_GUINT64_FORMAT, &id) == 1) {
+ sscanf(arg + 1, "%" G_GINT64_MODIFIER "x", &id) == 1) {
if (id < TWITTER_LOG_LENGTH && td->log)
id = td->log[id].id;
} else if ((bu = bee_user_by_handle(ic->bee, ic, arg)) &&
(tud = bu->data) && tud->last_id)
id = tud->last_id;
- else if (sscanf(arg, "%" G_GUINT64_FORMAT, &id) == 1){
+ else if (sscanf(arg, "%" G_GINT64_MODIFIER "x", &id) == 1){
if (id < TWITTER_LOG_LENGTH && td->log)
id = td->log[id].id;
}
diff --git a/protocols/twitter/twitter.h b/protocols/twitter/twitter.h
index ceac4371..8792b7c9 100644
--- a/protocols/twitter/twitter.h
+++ b/protocols/twitter/twitter.h
@@ -84,7 +84,7 @@ struct twitter_user_data
time_t last_time;
};
-#define TWITTER_LOG_LENGTH 100
+#define TWITTER_LOG_LENGTH 256
struct twitter_log_data
{
guint64 id;
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index fe276133..862104f5 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -643,10 +643,10 @@ static char *twitter_msg_add_id(struct im_connection *ic,
if (set_getbool(&ic->acc->set, "show_ids")) {
if (reply_to != -1)
- return g_strdup_printf("\002[\002%02d->%02d\002]\002 %s%s",
+ return g_strdup_printf("\002[\002%02x->%02x\002]\002 %s%s",
td->log_id, reply_to, prefix, txs->text);
else
- return g_strdup_printf("\002[\002%02d\002]\002 %s%s",
+ return g_strdup_printf("\002[\002%02x\002]\002 %s%s",
td->log_id, prefix, txs->text);
} else {
if (*prefix)