datatransfer: support awaiting_peer and awaiting_host states

Change-Id: Iada6fc5cf7d4d309074c36bc3ff586fb86133d6f
parent afbc9591
......@@ -217,8 +217,11 @@ build_interaction_json(lrc::api::ConversationModel& conversation_model,
case lrc::api::interaction::Status::TRANSFER_ONGOING:
interaction_object.insert("delivery_status", QJsonValue("ongoing"));
break;
case lrc::api::interaction::Status::TRANSFER_AWAITING:
interaction_object.insert("delivery_status", QJsonValue("awaiting"));
case lrc::api::interaction::Status::TRANSFER_AWAITING_PEER:
interaction_object.insert("delivery_status", QJsonValue("awaiting peer"));
break;
case lrc::api::interaction::Status::TRANSFER_AWAITING_HOST:
interaction_object.insert("delivery_status", QJsonValue("awaiting host"));
break;
case lrc::api::interaction::Status::TRANSFER_FINISHED:
interaction_object.insert("delivery_status", QJsonValue("finished"));
......
......@@ -479,17 +479,19 @@ ring.chatview = (function(){
// Update flat buttons
var left_buttons = message_div.querySelector("#left_buttons");
left_buttons.innerHTML = '';
if (message_delivery_status === 'awaiting') {
// add buttons to accept or refuse a call.
var accept_button = document.createElement('div');
accept_button.innerHTML = acceptSvg;
accept_button.setAttribute("id", "accept-btn");
accept_button.setAttribute("title", "Accept");
accept_button.setAttribute("class", "flat-button button-green");
accept_button.onclick = function() {
window.prompt('ACCEPT_FILE:' + message_id);
if (message_delivery_status.indexOf('awaiting') === 0) {
if (message_direction === 'in') {
// add buttons to accept or refuse a call.
var accept_button = document.createElement('div');
accept_button.innerHTML = acceptSvg;
accept_button.setAttribute("id", "accept-btn");
accept_button.setAttribute("title", "Accept");
accept_button.setAttribute("class", "flat-button button-green");
accept_button.onclick = function() {
window.prompt('ACCEPT_FILE:' + message_id);
}
left_buttons.appendChild(accept_button);
}
left_buttons.appendChild(accept_button);
var refuse_button = document.createElement('div');
refuse_button.innerHTML = refuseSvg;
refuse_button.setAttribute("id", "refuse-btn");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment