Changeset b2dc873 for protocols


Ignore:
Timestamp:
2013-01-19T19:25:19Z (8 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
fe92921
Parents:
be98957
git-author:
Miklos Vajna <vmiklos@…> (19-01-13 19:25:19)
git-committer:
Miklos Vajna <vmiklos@…> (19-01-13 19:25:19)
Message:

skype: provide more info about file transfers

Till now only a single line was printed, when a new offer arrived. Now
two more lines are printed:

  • when the actual transfer starts (offer accepted), with destination filename
  • when the transfer completes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/skype/skype.c

    rbe98957 rb2dc873  
    4646enum {
    4747        SKYPE_FILETRANSFER_NEW = 1,
     48        SKYPE_FILETRANSFER_TRANSFERRING,
     49        SKYPE_FILETRANSFER_COMPLETED,
    4850        SKYPE_FILETRANSFER_FAILED
    4951};
     
    8183        /* Same for file transfers. */
    8284        int filetransfer_status;
     85        /* Path of the file being transferred. */
     86        char *filetransfer_path;
    8387        /* Using /j #nick we want to have a groupchat with two people. Usually
    8488         * not (default). */
     
    783787                        id);
    784788                sd->filetransfer_status = SKYPE_FILETRANSFER_FAILED;
     789        } else if (!strcmp(info, "STATUS COMPLETED")) {
     790                skype_printf(ic, "GET FILETRANSFER %s PARTNER_HANDLE\n", id);
     791                sd->filetransfer_status = SKYPE_FILETRANSFER_COMPLETED;
     792        } else if (!strcmp(info, "STATUS TRANSFERRING")) {
     793                skype_printf(ic, "GET FILETRANSFER %s PARTNER_HANDLE\n", id);
     794                sd->filetransfer_status = SKYPE_FILETRANSFER_TRANSFERRING;
     795        } else if (!strncmp(info, "FILEPATH ", 9)) {
     796                info += 9;
     797                sd->filetransfer_path = g_strdup(info);
    785798        } else if (!strncmp(info, "PARTNER_HANDLE ", 15)) {
    786799                info += 15;
     
    795808                        imcb_log(ic, "Failed to transfer file from user %s.",
    796809                                info);
     810                        break;
     811                case SKYPE_FILETRANSFER_COMPLETED:
     812                        imcb_log(ic, "File transfer from user %s completed.", info);
     813                        break;
     814                case SKYPE_FILETRANSFER_TRANSFERRING:
     815                        if (sd->filetransfer_path) {
     816                                imcb_log(ic, "File transfer from user %s started, saving to %s.", info, sd->filetransfer_path);
     817                                g_free(sd->filetransfer_path);
     818                                sd->filetransfer_path = NULL;
     819                        }
    797820                        break;
    798821                }
Note: See TracChangeset for help on using the changeset viewer.