From a4458b56d19899767dd71ef46e5dfa7fea2948cd Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Wed, 3 Sep 2014 16:34:08 +0200 Subject: [PATCH] filetransfer: send progress notify Just a single notification confirming the whole file in one piece is enough to keep Lync happy. --- src/core/sipe-ft-lync.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/core/sipe-ft-lync.c b/src/core/sipe-ft-lync.c index 8dc659f4..8404732b 100644 --- a/src/core/sipe-ft-lync.c +++ b/src/core/sipe-ft-lync.c @@ -332,6 +332,35 @@ ft_lync_incoming_init(struct sipe_file_transfer *ft, } static void +send_transfer_progress(struct sipe_file_transfer_lync *ft_private) +{ + static const gchar *FILETRANSFER_PROGRESS = + "" + "" + "%d" + "" + "0" + "%d" + "" + "" + ""; + + send_ms_filetransfer_msg(g_strdup_printf(FILETRANSFER_PROGRESS, + rand(), + ft_private->request_id, + ft_private->file_size - 1), + ft_private, NULL); +} + +static gboolean +ft_lync_end(struct sipe_file_transfer *ft) +{ + send_transfer_progress(SIPE_FILE_TRANSFER_PRIVATE); + + return TRUE; +} + +static void ft_lync_deallocate(struct sipe_file_transfer *ft) { struct sipe_media_call *call = SIPE_FILE_TRANSFER_PRIVATE->call; @@ -378,6 +407,7 @@ process_incoming_invite_ft_lync(struct sipe_core_private *sipe_private, call->candidate_pair_established_cb = candidate_pair_established_cb; ft_private->public.ft_init = ft_lync_incoming_init; + ft_private->public.ft_end = ft_lync_end; ft_private->public.ft_deallocate = ft_lync_deallocate; stream = sipe_core_media_get_stream_by_id(call, "data"); -- 2.11.4.GIT