aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-02-29 01:49:43 +0100
committerMiklos Vajna <vmiklos@frugalware.org>2008-02-29 01:49:43 +0100
commit48181f05fef4c5c6624a06bcf5ce3648f63576dd (patch)
tree3c07213ad7196ccda13fab488a8a79192039ea66
parentacd94789946b2bc83ab529485a3342255a2cdecf (diff)
report call duration at the end
-rw-r--r--skype/README2
-rw-r--r--skype/skype.c16
2 files changed, 16 insertions, 2 deletions
diff --git a/skype/README b/skype/README
index 61334d85..5515ccc7 100644
--- a/skype/README
+++ b/skype/README
@@ -237,7 +237,7 @@ your VNC server regularly. (How ugly.)
- Running Skype on a machine different to BitlBee is possible, the
communication is encrypted.
-- Managing outgoing calls:
+- Managing outgoing calls (with call duration at the end):
* `account set skype/call nick`
* `account set -del skype/call`
diff --git a/skype/skype.c b/skype/skype.c
index 299e0768..291233e7 100644
--- a/skype/skype.c
+++ b/skype/skype.c
@@ -82,6 +82,7 @@ struct skype_data
* notification about the handle is in a given status. */
skype_call_status call_status;
char *call_id;
+ char *call_duration;
/* Same for file transfers. */
skype_filetransfer_status filetransfer_status;
/* Using /j #nick we want to have a groupchat with two people. Usually
@@ -598,6 +599,12 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
sd->call_id = g_strdup(id);
sd->call_status = SKYPE_CALL_UNPLACED;
}
+ else if(!strncmp(info, "DURATION ", 9))
+ {
+ if(sd->call_duration)
+ g_free(sd->call_duration);
+ sd->call_duration = g_strdup(info+9);
+ }
else if(!strncmp(info, "PARTNER_HANDLE ", 15))
{
info += 15;
@@ -617,7 +624,14 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
imcb_log(ic, "You cancelled the call to the user %s.", info);
break;
case SKYPE_CALL_FINISHED:
- imcb_log(ic, "You finished the call to the user %s.", info);
+ if(sd->call_duration)
+ {
+ imcb_log(ic, "You finished the call to the user %s (duration: %s seconds).", info, sd->call_duration);
+ }
+ else
+ {
+ imcb_log(ic, "You finished the call to the user %s.", info);
+ }
break;
default:
/* Don't be noisy, ignore other statuses for now. */