aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r--protocols/twitter/twitter_lib.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index 77f487ae..51963d39 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -790,7 +790,7 @@ static char *twitter_msg_add_id(struct im_connection *ic,
if (txs->reply_to) {
int i;
- for (i = 0; i < TWITTER_LOG_LENGTH; i++) {
+ for (i = 0; i < td->log_length; i++) {
if (td->log[i].id == txs->reply_to) {
reply_to = i;
break;
@@ -808,7 +808,7 @@ static char *twitter_msg_add_id(struct im_connection *ic,
}
}
- td->log_id = (td->log_id + 1) % TWITTER_LOG_LENGTH;
+ td->log_id = (td->log_id + 1) % td->log_length;
td->log[td->log_id].id = txs->id;
td->log[td->log_id].bu = bee_user_by_handle(ic->bee, ic, txs->user->screen_name);
@@ -823,11 +823,12 @@ 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%02x->%02x\002]\002 %s%s",
- td->log_id, reply_to, prefix, txs->text);
+ return g_strdup_printf("\002[\002%0*x->%0*x\002]\002 %s%s",
+ td->id_length, td->log_id, td->id_length,
+ reply_to, prefix, txs->text);
} else {
- return g_strdup_printf("\002[\002%02x\002]\002 %s%s",
- td->log_id, prefix, txs->text);
+ return g_strdup_printf("\002[\002%0*x\002]\002 %s%s",
+ td->id_length, td->log_id, prefix, txs->text);
}
} else {
if (*prefix) {
@@ -1092,7 +1093,7 @@ static gboolean twitter_stream_handle_status(struct im_connection *ic, struct tw
struct twitter_data *td = ic->proto_data;
int i;
- for (i = 0; i < TWITTER_LOG_LENGTH; i++) {
+ for (i = 0; i < td->log_length; i++) {
if (td->log[i].id == txs->id) {
/* Got a duplicate (RT, probably). Drop it. */
return TRUE;