Ignore:
Timestamp:
2013-02-21T13:16:26Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
06eef80
Parents:
e4f5ca8 (diff), 9754c2f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from vmiklos. Mostly Skype stuff and further deprecating a nogaim
function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/skype/skype.c

    re4f5ca8 r12f500f  
    2929#define SKYPE_DEFAULT_SERVER "localhost"
    3030#define SKYPE_DEFAULT_PORT "2727"
    31 #define IRC_LINE_SIZE 1024
     31#define IRC_LINE_SIZE 16384
    3232#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
    3333
     
    194194{
    195195        struct skype_buddy_ask_data *bla = data;
    196         skype_printf(bla->ic, "SET USER %s ISAUTHORIZED TRUE",
     196        skype_printf(bla->ic, "SET USER %s ISAUTHORIZED TRUE\n",
    197197                bla->handle);
    198198        g_free(bla->handle);
     
    203203{
    204204        struct skype_buddy_ask_data *bla = data;
    205         skype_printf(bla->ic, "SET USER %s ISAUTHORIZED FALSE",
     205        skype_printf(bla->ic, "SET USER %s ISAUTHORIZED FALSE\n",
    206206                bla->handle);
    207207        g_free(bla->handle);
     
    226226{
    227227        struct skype_buddy_ask_data *bla = data;
    228         skype_printf(bla->ic, "SET CALL %s STATUS INPROGRESS",
     228        skype_printf(bla->ic, "SET CALL %s STATUS INPROGRESS\n",
    229229                bla->handle);
    230230        g_free(bla->handle);
     
    235235{
    236236        struct skype_buddy_ask_data *bla = data;
    237         skype_printf(bla->ic, "SET CALL %s STATUS FINISHED",
     237        skype_printf(bla->ic, "SET CALL %s STATUS FINISHED\n",
    238238                bla->handle);
    239239        g_free(bla->handle);
     
    918918                        /* Number of users changed in this group, query its type to see
    919919                         * if it's a custom one we should care about. */
    920                         skype_printf(ic, "GET GROUP %s TYPE", id);
     920                        skype_printf(ic, "GET GROUP %s TYPE\n", id);
    921921                        return;
    922922                }
     
    927927
    928928                if (sg) {
    929                         skype_printf(ic, "ALTER GROUP %d ADDUSER %s", sg->id, sd->pending_user);
     929                        skype_printf(ic, "ALTER GROUP %d ADDUSER %s\n", sg->id, sd->pending_user);
    930930                        g_free(sd->pending_user);
    931931                        sd->pending_user = NULL;
     
    935935        } else if (!strcmp(info, "TYPE CUSTOM_GROUP"))
    936936                /* This one is interesting, query its users. */
    937                 skype_printf(ic, "GET GROUP %s USERS", id);
     937                skype_printf(ic, "GET GROUP %s USERS\n", id);
    938938}
    939939
     
    11471147        /* Read the whole data. */
    11481148        st = ssl_read(sd->ssl, buf, sizeof(buf));
     1149        if (st >= IRC_LINE_SIZE-1) {
     1150                /* As we don't buffer incoming data, if IRC_LINE_SIZE amount of bytes
     1151                 * were received, there's a good chance last message was truncated
     1152                 * and the next recv() will yield garbage. */
     1153                imcb_error(ic, "Unable to handle incoming data from skyped");
     1154                st = 0;
     1155        }
    11491156        if (st > 0) {
    11501157                buf[st] = '\0';
     
    13381345        struct im_connection *ic = acc->ic;
    13391346
    1340         skype_printf(ic, "SET PROFILE FULLNAME %s", value);
     1347        skype_printf(ic, "SET PROFILE FULLNAME %s\n", value);
    13411348        return value;
    13421349}
     
    13471354        struct im_connection *ic = acc->ic;
    13481355
    1349         skype_printf(ic, "SET PROFILE MOOD_TEXT %s", value);
     1356        skype_printf(ic, "SET PROFILE MOOD_TEXT %s\n", value);
    13501357        return value;
    13511358}
     
    13561363        struct im_connection *ic = acc->ic;
    13571364
    1358         skype_printf(ic, "GET PROFILE PSTN_BALANCE");
     1365        skype_printf(ic, "GET PROFILE PSTN_BALANCE\n");
    13591366        return value;
    13601367}
     
    13671374        if (ptr)
    13681375                *ptr = '\0';
    1369         skype_printf(ic, "CALL %s", nick);
     1376        skype_printf(ic, "CALL %s\n", nick);
    13701377        g_free(nick);
    13711378}
     
    13761383
    13771384        if (sd->call_id) {
    1378                 skype_printf(ic, "SET CALL %s STATUS FINISHED",
     1385                skype_printf(ic, "SET CALL %s STATUS FINISHED\n",
    13791386                                sd->call_id);
    13801387                g_free(sd->call_id);
     
    14161423                        /* No such group, we need to create it, then have to
    14171424                         * add the user once it's created. */
    1418                         skype_printf(ic, "CREATE GROUP %s", group);
     1425                        skype_printf(ic, "CREATE GROUP %s\n", group);
    14191426                        sd->pending_user = g_strdup(nick);
    14201427                } else {
    1421                         skype_printf(ic, "ALTER GROUP %d ADDUSER %s", sg->id, nick);
     1428                        skype_printf(ic, "ALTER GROUP %d ADDUSER %s\n", sg->id, nick);
    14221429                }
    14231430        }
     
    15231530}
    15241531
    1525 static void skype_set_my_name(struct im_connection *ic, char *info)
    1526 {
    1527         skype_set_display_name(set_find(&ic->acc->set, "display_name"), info);
    1528 }
    1529 
    15301532static void skype_init(account_t *acc)
    15311533{
     
    15841586
    15851587        if (ret == NULL) {
    1586                 static const struct buddy_action ba[3] = {
     1588                static const struct buddy_action ba[2] = {
    15871589                        {"CALL", "Initiate a call" },
    15881590                        {"HANGUP", "Hang up a call" },
    15891591                };
    1590 
    1591                 ret = g_list_prepend(ret, (void *) ba + 0);
     1592                int i;
     1593
     1594                for (i = 0; i < ARRAY_SIZE(ba); i++)
     1595                        ret = g_list_prepend(ret, (void *)(ba + i));
    15921596        }
    15931597
     
    16201624        ret->buddy_msg = skype_buddy_msg;
    16211625        ret->get_info = skype_get_info;
    1622         ret->set_my_name = skype_set_my_name;
    16231626        ret->away_states = skype_away_states;
    16241627        ret->set_away = skype_set_away;
Note: See TracChangeset for help on using the changeset viewer.