Changeset e0074cb


Ignore:
Timestamp:
2008-02-29T02:08:14Z (16 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
f578275
Parents:
d87daf3
Message:

manage incoming calls via questions

Location:
skype
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skype/README

    rd87daf3 re0074cb  
    243243  * `account set -del skype/call`
    244244
     245- Managing incoming calls via questions, just like when you add / remove
     246  contacts.
     247
    245248== What needs to be done (aka. TODO)
    246 
    247 - Add support for accepting/rejecting calls via settings.
    248249
    249250- Notice if foo invites bar. Currently you can see only that bar joined.
  • skype/skype.c

    rd87daf3 re0074cb  
    120120{
    121121        struct im_connection *ic;
     122        /* This is also used for call IDs for simplicity */
    122123        char *handle;
    123124};
     
    195196}
    196197
     198static void skype_call_ask_yes( gpointer w, struct skype_buddy_ask_data *bla )
     199{
     200        char *buf = g_strdup_printf("SET CALL %s STATUS INPROGRESS", bla->handle);
     201        skype_write( bla->ic, buf, strlen( buf ) );
     202        g_free(buf);
     203        g_free(bla->handle);
     204        g_free(bla);
     205}
     206
     207static void skype_call_ask_no( gpointer w, struct skype_buddy_ask_data *bla )
     208{
     209        char *buf = g_strdup_printf("SET CALL %s STATUS FINISHED", bla->handle);
     210        skype_write( bla->ic, buf, strlen( buf ) );
     211        g_free(buf);
     212        g_free(bla->handle);
     213        g_free(bla);
     214}
     215
     216void skype_call_ask( struct im_connection *ic, char *call_id, char *message)
     217{
     218        struct skype_buddy_ask_data *bla = g_new0( struct skype_buddy_ask_data, 1 );
     219
     220        bla->ic = ic;
     221        bla->handle = g_strdup(call_id);
     222
     223        imcb_ask( ic, message, bla, skype_call_ask_yes, skype_call_ask_no );
     224}
    197225struct groupchat *skype_chat_by_name( struct im_connection *ic, char *name )
    198226{
     
    567595                                        if(!strcmp(info, "STATUS RINGING"))
    568596                                        {
     597                                                if(sd->call_id)
     598                                                        g_free(sd->call_id);
     599                                                sd->call_id = g_strdup(id);
    569600                                                g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);
    570601                                                skype_write( ic, buf, strlen( buf ) );
     
    619650                                                                                imcb_log(ic, "You are currently ringing the user %s.", info);
    620651                                                                        else
    621                                                                                 imcb_log(ic, "The user %s is currently ringing you.", info);
     652                                                                        {
     653                                                                                g_snprintf(buf, 1024, "The user %s is currently ringing you.", info);
     654                                                                                skype_call_ask(ic, sd->call_id, buf);
     655                                                                        }
    622656                                                                        break;
    623657                                                                case SKYPE_CALL_MISSED:
Note: See TracChangeset for help on using the changeset viewer.