diff options
| author | Miklos Vajna <vmiklos@frugalware.org> | 2008-02-29 01:09:22 +0100 | 
|---|---|---|
| committer | Miklos Vajna <vmiklos@frugalware.org> | 2008-02-29 01:09:22 +0100 | 
| commit | 9db023404848798a90183c8fc27f6ffe890cdb25 (patch) | |
| tree | b42dfdfaa15f386f62cc9a5bb93f61bf1b7aec32 /skype/skype.c | |
| parent | 123e45a0a4dee7ad5b4c3ea0310397f570f2b357 (diff) | |
finetune ringing message
old:
the user foo is ringing you
new:
you are ringing the user foo
or
the user foo is ringing you
Diffstat (limited to 'skype/skype.c')
| -rw-r--r-- | skype/skype.c | 19 | 
1 files changed, 16 insertions, 3 deletions
| diff --git a/skype/skype.c b/skype/skype.c index 7e1ef142..82ecc4de 100644 --- a/skype/skype.c +++ b/skype/skype.c @@ -40,7 +40,10 @@  typedef enum  {  	SKYPE_CALL_RINGING = 1, -	SKYPE_CALL_MISSED +	SKYPE_CALL_MISSED, +	SKYPE_CALL_UNPLACED, +	/* This means we are ringing somebody, not somebody rings us. */ +	SKYPE_CALL_RINGING_OUT  } skype_call_status;  typedef enum @@ -561,7 +564,10 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c  					{  						g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id);  						skype_write( ic, buf, strlen( buf ) ); -						sd->call_status = SKYPE_CALL_RINGING; +						if(sd->call_status != SKYPE_CALL_UNPLACED) +							sd->call_status = SKYPE_CALL_RINGING; +						else +							sd->call_status = SKYPE_CALL_RINGING_OUT;  					}  					else if(!strcmp(info, "STATUS MISSED"))  					{ @@ -569,6 +575,8 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c  						skype_write( ic, buf, strlen( buf ) );  						sd->call_status = SKYPE_CALL_MISSED;  					} +					else if(!strcmp(info, "STATUS UNPLACED")) +						sd->call_status = SKYPE_CALL_UNPLACED;  					else if(!strncmp(info, "PARTNER_HANDLE ", 15))  					{  						info += 15; @@ -581,6 +589,12 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c  								case SKYPE_CALL_MISSED:  									imcb_log(ic, "You have missed a call from user %s.", info);  									break; +								case SKYPE_CALL_RINGING_OUT: +									imcb_log(ic, "You are currently ringing the user %s.", info); +									break; +								default: +									/* Don't be noisy, ignore other statuses for now. */ +									break;  							}  							sd->call_status = 0;  						} @@ -910,7 +924,6 @@ static char *skype_set_call( set_t *set, char *value )  	skype_write( ic, buf, strlen( buf ) );  	g_free(buf);  	g_free(nick); -	imcb_log(ic, "Ringing the user %s.", value);  	return(value);  } | 
