Changeset 6627d92


Ignore:
Timestamp:
2007-08-20T20:58:45Z (17 years ago)
Author:
VMiklos <vmiklos@…>
Branches:
master
Children:
7e4f0ca1
Parents:
a60c3c2
Message:

implement add/removing contacts

Location:
skype
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skype/README

    ra60c3c2 r6627d92  
    8787- Marking received messages as seen so that Skype won't say there are unread messages
    8888
     89- Adding / removing contacts
     90
    8991== What needs to be done (aka. TODO)
    9092
    91 - add/remove users, detect when somebody wants to add us
     93- detect when somebody wants to add us
    9294
    9395- Due to some API limitations, I have no idea how to change status. This affects:
  • skype/skype.c

    ra60c3c2 r6627d92  
    109109                                ptr = strchr(++user, ' ');
    110110                                *ptr = '\0';
    111                                 if(strcmp(user, sd->username) != 0 && strcmp(user, "echo123") != 0)
     111                                ptr++;
     112                                if(!strncmp(ptr, "ONLINESTATUS ", 13) && strcmp(user, sd->username) != 0 && strcmp(user, "echo123") != 0)
    112113                                {
    113114                                        ptr = g_strdup_printf("%s@skype.com", user);
     
    275276static void skype_add_buddy( struct im_connection *ic, char *who, char *group )
    276277{
     278        char *buf, *nick, *ptr;
     279
     280        nick = g_strdup_printf("%s", who);
     281        ptr = strchr(nick, '@');
     282        if(ptr)
     283                *ptr = '\0';
     284        buf = g_strdup_printf("SET USER %s BUDDYSTATUS 2 Please authorize me\n", nick);
     285        skype_write( ic, buf, strlen( buf ) );
     286        printf("add '%s'\n", nick);
     287        g_free(nick);
    277288}
    278289
    279290static void skype_remove_buddy( struct im_connection *ic, char *who, char *group )
    280291{
     292        char *buf, *nick, *ptr;
     293
     294        nick = g_strdup_printf("%s", who);
     295        ptr = strchr(nick, '@');
     296        if(ptr)
     297                *ptr = '\0';
     298        buf = g_strdup_printf("SET USER %s BUDDYSTATUS 1\n", nick);
     299        skype_write( ic, buf, strlen( buf ) );
     300        printf("remove '%s'\n", nick);
     301        g_free(nick);
    281302}
    282303
Note: See TracChangeset for help on using the changeset viewer.