internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest req) { FileSendRequestResponseRq request = (FileSendRequestResponseRq)req; FileSendRequestResponseRs response = new FileSendRequestResponseRs(); try { ((Function)engagement.GetFunction("FileSend")).ProcessFileSendRequestResponse(request.accepted,request.fileSendId); } catch (Exception e) { Logger.Error("Failed to process incoming FileSend request response : " + e.Message, e); response.error = "INTERNAL_SERVER_ERROR"; response.errorMessage = "Failed to process incoming FileSend request response"; } return response; }
// Async callback from our file send request response private void FileSendRequestResponseResponseHandler(FileSendInfo fileInfo, FileSendRequestResponseRq request, FileSendRequestResponseRs response, Exception e) { { if (e != null) { RemovePendingFileReceive(request.fileSendId); Logger.Error("Failed to send the FileSendRequestResponse for file " + request.fileSendId + " : " + e.Message, e); fileInfo.FileReceiver.Close(); _appContext.NotificationManager.DeleteNotification(fileInfo.Notification); Chat.LogSystemMessage("An error occured receiving the file"); } else { OnNewActivity(new FileSendActivity(_engagement, FileSendActivity.FILE_SEND_RESPONSE) { From = "_SELF", To = _engagement.SecondParty.Party.Username, FileInfo = fileInfo, Answer = true }); } } }