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.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index 40adb992..be3201a9 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -673,7 +673,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;
@@ -691,7 +691,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);
@@ -706,11 +706,21 @@ 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);
+ if (td->long_ids) {
+ return g_strdup_printf("\002[\002%04x->%04x\002]\002 %s%s",
+ td->log_id, reply_to, prefix, txs->text);
+ } else {
+ 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%02x\002]\002 %s%s",
- td->log_id, prefix, txs->text);
+ if (td->long_ids) {
+ return g_strdup_printf("\002[\002%04x\002]\002 %s%s",
+ td->log_id, prefix, txs->text);
+ } else {
+ return g_strdup_printf("\002[\002%02x\002]\002 %s%s",
+ td->log_id, prefix, txs->text);
+ }
}
} else {
if (*prefix) {
@@ -961,7 +971,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;