Changeset f0493b1


Ignore:
Timestamp:
2010-03-19T16:44:46Z (14 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
cc7a153
Parents:
a73d6b2
Message:

checkpatch fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/skype.c

    ra73d6b2 rf0493b1  
    506506        *info = '\0';
    507507        info++;
    508         if (!strcmp(info, "STATUS RECEIVED") || !strncmp(info, "EDITED_TIMESTAMP", 16)) {
     508        if (!strcmp(info, "STATUS RECEIVED") ||
     509                !strncmp(info, "EDITED_TIMESTAMP", 16)) {
    509510                /* New message ID:
    510511                 * (1) Request its from field
     
    544545                g_free(sd->type);
    545546                sd->type = g_strdup(info);
    546         } else if (!strncmp(info, "CHATNAME ", 9)) {
    547                 info += 9;
    548                 if (sd->handle && sd->body && sd->type) {
    549                         struct groupchat *gc = skype_chat_by_name(ic, info);
    550                         int i;
    551                         for (i = 0; i < g_list_length(sd->body); i++) {
    552                                 char *body = g_list_nth_data(sd->body, i);
    553                                 if (!strcmp(sd->type, "SAID") ||
    554                                         !strcmp(sd->type, "EMOTED")) {
    555                                         if (!strcmp(sd->type, "SAID")) {
    556                                                 if (!sd->is_edit)
    557                                                         g_snprintf(buf, IRC_LINE_SIZE, "%s",
    558                                                                 body);
    559                                                 else {
    560                                                         g_snprintf(buf, IRC_LINE_SIZE, "%s %s",
    561                                                                 set_getstr(&ic->acc->set, "edit_prefix"),
    562                                                                 body);
    563                                                         sd->is_edit = 0;
    564                                                 }
    565                                         } else
    566                                                 g_snprintf(buf, IRC_LINE_SIZE, "/me %s",
    567                                                         body);
    568                                         if (!gc)
    569                                                 /* Private message */
    570                                                 imcb_buddy_msg(ic,
    571                                                         sd->handle, buf, 0, 0);
    572                                         else
    573                                                 /* Groupchat message */
    574                                                 imcb_chat_msg(gc,
    575                                                         sd->handle, buf, 0, 0);
    576                                 } else if (!strcmp(sd->type, "SETTOPIC") && gc)
    577                                         imcb_chat_topic(gc,
    578                                                 sd->handle, body, 0);
    579                                 else if (!strcmp(sd->type, "LEFT") && gc)
    580                                         imcb_chat_remove_buddy(gc,
    581                                                 sd->handle, NULL);
     547        } else if (strncmp(info, "CHATNAME ", 9))
     548                return;
     549        if (!sd->handle || !sd->body || !sd->type)
     550                return;
     551        info += 9;
     552        struct groupchat *gc = skype_chat_by_name(ic, info);
     553        int i;
     554        for (i = 0; i < g_list_length(sd->body); i++) {
     555                char *body = g_list_nth_data(sd->body, i);
     556                if (!strcmp(sd->type, "SETTOPIC") && gc)
     557                        imcb_chat_topic(gc,
     558                                sd->handle, body, 0);
     559                else if (!strcmp(sd->type, "LEFT") && gc)
     560                        imcb_chat_remove_buddy(gc,
     561                                sd->handle, NULL);
     562                if (strcmp(sd->type, "SAID") &&
     563                        strcmp(sd->type, "EMOTED"))
     564                        continue;
     565                if (!strcmp(sd->type, "SAID")) {
     566                        if (!sd->is_edit)
     567                                g_snprintf(buf, IRC_LINE_SIZE, "%s",
     568                                        body);
     569                        else {
     570                                account_t *acc = ic->acc;
     571                                g_snprintf(buf, IRC_LINE_SIZE, "%s %s",
     572                                        set_getstr(&acc->set, "edit_prefix"),
     573                                        body);
     574                                sd->is_edit = 0;
    582575                        }
    583                         g_list_free(sd->body);
    584                         sd->body = NULL;
    585                 }
     576                } else
     577                        g_snprintf(buf, IRC_LINE_SIZE, "/me %s",
     578                                body);
     579                if (!gc)
     580                        /* Private message */
     581                        imcb_buddy_msg(ic,
     582                                sd->handle, buf, 0, 0);
     583                else
     584                        /* Groupchat message */
     585                        imcb_chat_msg(gc,
     586                                sd->handle, buf, 0, 0);
    586587        }
     588        g_list_free(sd->body);
     589        sd->body = NULL;
    587590}
    588591
Note: See TracChangeset for help on using the changeset viewer.