Changeset d87daf3


Ignore:
Timestamp:
2008-02-29T01:40:12Z (16 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
e0074cb
Parents:
a92fb07
Message:

replace the fake SKYPE_CALL_RINGING_OUT with a proper call_out variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/skype.c

    ra92fb07 rd87daf3  
    4242        SKYPE_CALL_RINGING = 1,
    4343        SKYPE_CALL_MISSED,
    44         SKYPE_CALL_UNPLACED,
    4544        SKYPE_CALL_CANCELLED,
    4645        SKYPE_CALL_FINISHED,
    47         SKYPE_CALL_REFUSED,
    48         /* This means we are ringing somebody, not somebody rings us. */
    49         SKYPE_CALL_RINGING_OUT
     46        SKYPE_CALL_REFUSED
    5047} skype_call_status;
    5148
     
    8582        char *call_id;
    8683        char *call_duration;
     84        /* If the call is outgoing or not */
     85        int call_out;
    8786        /* Same for file transfers. */
    8887        skype_filetransfer_status filetransfer_status;
     
    570569                                                g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
    571570                                                skype_write( ic, buf, strlen( buf ) );
    572                                                 if(sd->call_status != SKYPE_CALL_UNPLACED)
    573                                                         sd->call_status = SKYPE_CALL_RINGING;
    574                                                 else
    575                                                         sd->call_status = SKYPE_CALL_RINGING_OUT;
     571                                                sd->call_status = SKYPE_CALL_RINGING;
    576572                                        }
    577573                                        else if(!strcmp(info, "STATUS MISSED"))
     
    583579                                        else if(!strcmp(info, "STATUS CANCELLED"))
    584580                                        {
    585                                                 g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
    586                                                 skype_write( ic, buf, strlen( buf ) );
    587                                                 sd->call_status = SKYPE_CALL_CANCELLED;
     581                                                        g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
     582                                                        skype_write( ic, buf, strlen( buf ) );
     583                                                        sd->call_status = SKYPE_CALL_CANCELLED;
    588584                                        }
    589585                                        else if(!strcmp(info, "STATUS FINISHED"))
     
    605601                                                /* Save the ID for later usage (Cancel/Finish). */
    606602                                                sd->call_id = g_strdup(id);
    607                                                 sd->call_status = SKYPE_CALL_UNPLACED;
     603                                                sd->call_out = TRUE;
    608604                                        }
    609605                                        else if(!strncmp(info, "DURATION ", 9))
     
    620616                                                        {
    621617                                                                case SKYPE_CALL_RINGING:
    622                                                                         imcb_log(ic, "The user %s is currently ringing you.", info);
     618                                                                        if(sd->call_out)
     619                                                                                imcb_log(ic, "You are currently ringing the user %s.", info);
     620                                                                        else
     621                                                                                imcb_log(ic, "The user %s is currently ringing you.", info);
    623622                                                                        break;
    624623                                                                case SKYPE_CALL_MISSED:
    625624                                                                        imcb_log(ic, "You have missed a call from user %s.", info);
    626625                                                                        break;
    627                                                                 case SKYPE_CALL_RINGING_OUT:
    628                                                                         imcb_log(ic, "You are currently ringing the user %s.", info);
    629                                                                         break;
    630626                                                                case SKYPE_CALL_CANCELLED:
    631627                                                                        imcb_log(ic, "You cancelled the call to the user %s.", info);
     628                                                                        sd->call_status = 0;
     629                                                                        sd->call_out = FALSE;
    632630                                                                        break;
    633631                                                                case SKYPE_CALL_REFUSED:
    634                                                                         imcb_log(ic, "The user %s refused the call.", info);
     632                                                                        if(sd->call_out)
     633                                                                                imcb_log(ic, "The user %s refused the call.", info);
     634                                                                        else
     635                                                                                imcb_log(ic, "You refused the call from user %s.", info);
     636                                                                        sd->call_out = FALSE;
    635637                                                                        break;
    636638                                                                case SKYPE_CALL_FINISHED:
    637639                                                                        if(sd->call_duration)
    638                                                                         {
    639640                                                                                imcb_log(ic, "You finished the call to the user %s (duration: %s seconds).", info, sd->call_duration);
    640                                                                         }
    641641                                                                        else
    642                                                                         {
    643642                                                                                imcb_log(ic, "You finished the call to the user %s.", info);
    644                                                                         }
     643                                                                        sd->call_out = FALSE;
    645644                                                                        break;
    646645                                                                default:
Note: See TracChangeset for help on using the changeset viewer.