diff options
author | VMiklos <vmiklos@frugalware.org> | 2007-08-19 17:50:22 +0200 |
---|---|---|
committer | VMiklos <vmiklos@frugalware.org> | 2007-08-19 17:50:22 +0200 |
commit | be975f86a1b9ab4e41dacad0f6ef5f87edb988ed (patch) | |
tree | 89300621ead1fc4aca8033e232f802a04a7113b4 | |
parent | 9fd42411191bb42e51c14c24d454c1855f0b4885 (diff) |
add offline users, too
-rw-r--r-- | skype/skype.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/skype/skype.c b/skype/skype.c index 582614ae..978ceec8 100644 --- a/skype/skype.c +++ b/skype/skype.c @@ -81,16 +81,16 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c } else if(!strncmp(line, "USER ", 5)) { - // TODO we should add the buddy even if the status is offline - if((ptr = strrchr(line, ' ')) && strcmp(++ptr, "OFFLINE") != 0) - { - char *user = strchr(line, ' '); - ptr = strchr(++user, ' '); - *ptr = '\0'; - ptr = g_strdup_printf("%s@skype.com", user); - imcb_add_buddy(ic, ptr, NULL); + char *status = strrchr(line, ' '); + char *user = strchr(line, ' '); + ptr = strchr(++user, ' '); + *ptr = '\0'; + ptr = g_strdup_printf("%s@skype.com", user); + imcb_add_buddy(ic, ptr, NULL); + // TODO online can be away + if(strcmp(++status, "OFFLINE") != 0) imcb_buddy_status(ic, ptr, OPT_LOGGED_IN, NULL, NULL); - } + g_free(ptr); } lineptr++; } |