Commit c92e3b50 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #13010: remove RECORD state, and merged UNHOLD_CURRENT and UNHOLD_RECORD into UNHOLD

parent a5d36c07
......@@ -93,7 +93,7 @@ Call::getStateStr()
return isIncoming() ? "INCOMING" : "RINGING";
case CONNECTED:
default:
return isRecording() ? "RECORD" : "CURRENT";
return "CURRENT";
}
case HOLD:
......
......@@ -514,8 +514,7 @@
<li>BUSY</li>
<li>FAILURE: Error when processing a call</li>
<li>HOLD</li>
<li>UNHOLD_CURRENT</li>
<li>UNHOLD_RECORD</li>
<li>UNHOLD</li>
</ul>
</tp:docstring>
</arg>
......
......@@ -329,11 +329,7 @@ bool ManagerImpl::answerCall(const std::string& call_id)
setRecordingCall(call_id);
// update call state on client side
if (audioPreference.getIsAlwaysRecording())
dbus_.getCallManager()->callStateChanged(call_id, "RECORD");
else
dbus_.getCallManager()->callStateChanged(call_id, "CURRENT");
dbus_.getCallManager()->callStateChanged(call_id, "CURRENT");
return true;
}
......@@ -488,8 +484,6 @@ void ManagerImpl::offHoldCall(const std::string& callId)
detachParticipant(MainBuffer::DEFAULT_ID, currentCallId);
}
bool isRec = false;
if (isIPToIP(callId))
SIPVoIPLink::instance()->offhold(callId);
else {
......@@ -498,13 +492,11 @@ void ManagerImpl::offHoldCall(const std::string& callId)
DEBUG("Setting offhold, Account %s, callid %s", accountId.c_str(), callId.c_str());
Call * call = getAccountLink(accountId)->getCall(callId);
if (call) {
isRec = call->isRecording();
if (call)
getAccountLink(accountId)->offhold(callId);
}
}
dbus_.getCallManager()->callStateChanged(callId, isRec ? "UNHOLD_RECORD" : "UNHOLD_CURRENT");
dbus_.getCallManager()->callStateChanged(callId, "UNHOLD");
if (isConferenceParticipant(callId)) {
Call *call = getCallFromCallID(callId);
......@@ -929,11 +921,9 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string&
} else if (call1_state_str == "INCOMING") {
conf->bindParticipant(callId1);
answerCall(callId1);
} else if (call1_state_str == "CURRENT")
conf->bindParticipant(callId1);
else if (call1_state_str == "RECORD")
} else if (call1_state_str == "CURRENT") {
conf->bindParticipant(callId1);
else if (call1_state_str == "INACTIVE") {
} else if (call1_state_str == "INACTIVE") {
conf->bindParticipant(callId1);
answerCall(callId1);
} else
......@@ -949,11 +939,9 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string&
} else if (call2_state_str == "INCOMING") {
conf->bindParticipant(callId2);
answerCall(callId2);
} else if (call2_state_str == "CURRENT")
conf->bindParticipant(callId2);
else if (call2_state_str == "RECORD")
} else if (call2_state_str == "CURRENT") {
conf->bindParticipant(callId2);
else if (call2_state_str == "INACTIVE") {
} else if (call2_state_str == "INACTIVE") {
conf->bindParticipant(callId2);
answerCall(callId2);
} else
......@@ -1520,11 +1508,10 @@ void ManagerImpl::peerAnsweredCall(const std::string& id)
audiodriver_->flushUrgent();
}
if (audioPreference.getIsAlwaysRecording()) {
if (audioPreference.getIsAlwaysRecording())
setRecordingCall(id);
dbus_.getCallManager()->callStateChanged(id, "RECORD");
} else
dbus_.getCallManager()->callStateChanged(id, "CURRENT");
dbus_.getCallManager()->callStateChanged(id, "CURRENT");
}
//THREAD=VoIP Call=Outgoing
......
......@@ -312,7 +312,6 @@ sflphone_hang_up()
case CALL_STATE_CURRENT:
case CALL_STATE_HOLD:
case CALL_STATE_BUSY:
case CALL_STATE_RECORD:
dbus_hang_up(selectedCall);
call_remove_all_errors(selectedCall);
selectedCall->_state = CALL_STATE_DIALING;
......@@ -398,7 +397,6 @@ sflphone_pick_up()
break;
case CALL_STATE_CURRENT:
case CALL_STATE_HOLD:
case CALL_STATE_RECORD:
case CALL_STATE_RINGING:
sflphone_new_call();
break;
......@@ -417,7 +415,6 @@ sflphone_on_hold()
if (selectedCall) {
switch (selectedCall->_state) {
case CALL_STATE_CURRENT:
case CALL_STATE_RECORD:
dbus_hold(selectedCall);
break;
default:
......@@ -476,17 +473,6 @@ sflphone_current(callable_obj_t * c)
update_actions();
}
void
sflphone_record(callable_obj_t * c)
{
if (c->_state != CALL_STATE_HOLD)
time(&c->_time_start);
c->_state = CALL_STATE_RECORD;
calltree_update_call(current_calls_tab, c);
update_actions();
}
void
sflphone_set_transfer()
{
......@@ -659,7 +645,6 @@ sflphone_keypad(guint keyval, gchar * key)
case CALL_STATE_DIALING: // Currently dialing => edit number
process_dialing(c, keyval, key);
break;
case CALL_STATE_RECORD:
case CALL_STATE_CURRENT:
switch (keyval) {
......@@ -855,19 +840,6 @@ sflphone_rec_call()
if (selectedCall) {
DEBUG("Set record for selected call");
dbus_set_record(selectedCall->_callID);
switch (selectedCall->_state) {
case CALL_STATE_CURRENT:
selectedCall->_state = CALL_STATE_RECORD;
break;
case CALL_STATE_RECORD:
selectedCall->_state = CALL_STATE_CURRENT;
break;
default:
WARN("Should not happen in sflphone_off_hold ()!");
break;
}
calltree_update_call(current_calls_tab, selectedCall);
} else if (selectedConf) {
DEBUG("Set record for selected conf");
......
......@@ -192,8 +192,6 @@ void sflphone_fill_codec_list_per_account(account_t *);
void sflphone_add_participant();
void sflphone_record(callable_obj_t *c);
void sflphone_rec_call(void);
void sflphone_mute_call(void);
......
......@@ -69,7 +69,6 @@ typedef enum {
CALL_STATE_FAILURE,
CALL_STATE_BUSY,
CALL_STATE_TRANSFER,
CALL_STATE_RECORD,
} call_state_t;
static const char * const TIMESTAMP_START_KEY = "timestamp_start";
......
......@@ -648,7 +648,10 @@ update_call(GtkTreeModel *model, GtkTreePath *path UNUSED, GtkTreeIter *iter, gp
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL);
break;
case CALL_STATE_CURRENT:
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL);
if (dbus_get_is_recording(call))
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL);
else
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL);
break;
case CALL_STATE_DIALING:
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL);
......@@ -662,9 +665,6 @@ update_call(GtkTreeModel *model, GtkTreePath *path UNUSED, GtkTreeIter *iter, gp
case CALL_STATE_TRANSFER:
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfer.svg", NULL);
break;
case CALL_STATE_RECORD:
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL);
break;
default:
WARN("Update calltree - Should not happen!");
}
......@@ -783,15 +783,15 @@ void calltree_add_call(calltab_t* tab, callable_obj_t * call, GtkTreeIter *paren
break;
case CALL_STATE_CURRENT:
// If the call has been initiated by a another client and, when we start, it is already current
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL);
if (dbus_get_is_recording(call))
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL);
else
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL);
break;
case CALL_STATE_HOLD:
// If the call has been initiated by a another client and, when we start, it is already current
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL);
break;
case CALL_STATE_RECORD:
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/icon_rec.svg", NULL);
break;
case CALL_STATE_FAILURE:
// If the call has been initiated by a another client and, when we start, it is already current
pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL);
......
......@@ -514,8 +514,7 @@
<li>BUSY</li>
<li>FAILURE: Error when processing a call</li>
<li>HOLD</li>
<li>UNHOLD_CURRENT</li>
<li>UNHOLD_RECORD</li>
<li>UNHOLD</li>
</ul>
</tp:docstring>
</arg>
......
......@@ -203,19 +203,12 @@ process_existing_call_state_change(callable_obj_t *c, const gchar *state)
calltree_update_call(history_tab, c);
status_bar_display_account();
sflphone_hung_up(c);
}
else if (g_strcmp0(state, "UNHOLD_CURRENT") == 0)
} else if (g_strcmp0(state, "UNHOLD") == 0 || g_strcmp0(state, "CURRENT") == 0)
sflphone_current(c);
else if (g_strcmp0(state, "UNHOLD_RECORD") == 0)
sflphone_record(c);
else if (g_strcmp0(state, "HOLD") == 0)
sflphone_hold(c);
else if (g_strcmp0(state, "RINGING") == 0)
sflphone_ringing(c);
else if (g_strcmp0(state, "CURRENT") == 0)
sflphone_current(c);
else if (g_strcmp0(state, "RECORD") == 0)
sflphone_record(c);
else if (g_strcmp0(state, "FAILURE") == 0)
sflphone_fail(c);
else if (g_strcmp0(state, "BUSY") == 0)
......@@ -242,9 +235,7 @@ process_nonexisting_call_state_change(const gchar *callID, const gchar *state)
// The callID is unknown, treat it like a new call
// If it were an incoming call, we won't be here
// It means that a new call has been initiated with an other client (cli for instance)
if (g_strcmp0(state, "RINGING") == 0 ||
g_strcmp0(state, "CURRENT") == 0 ||
g_strcmp0(state, "RECORD")) {
if (g_strcmp0(state, "RINGING") == 0 || g_strcmp0(state, "CURRENT") == 0) {
DEBUG("New ringing call! accountID: %s", callID);
......@@ -344,7 +335,7 @@ conference_created_cb(DBusGProxy *proxy UNUSED, const gchar *confID, void *foo U
im_widget_update_state(IM_WIDGET(call->_im_widget), FALSE);
// if one of these participants is currently recording, the whole conference will be recorded
if (call->_state == CALL_STATE_RECORD)
if (dbus_get_is_recording(call))
new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
call->_historyConfID = g_strdup(confID);
......
......@@ -106,7 +106,6 @@ toggle_pick_up_hang_up_callback()
case CALL_STATE_DIALING:
case CALL_STATE_HOLD:
case CALL_STATE_CURRENT:
case CALL_STATE_RECORD:
case CALL_STATE_RINGING:
sflphone_hang_up();
break;
......@@ -140,7 +139,6 @@ toggle_hold_callback()
if (selectedCall) {
switch (selectedCall->_state) {
case CALL_STATE_CURRENT:
case CALL_STATE_RECORD:
sflphone_on_hold();
break;
case CALL_STATE_HOLD:
......
......@@ -138,7 +138,8 @@ call_mute(void)
static void
update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging_enabled) {
update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging_enabled)
{
int pos = 0;
DEBUG("Update actions for call %s", selectedCall->_callID);
......@@ -238,39 +239,6 @@ update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging
g_signal_handler_block(transferToolbar_, transferButtonConnId_);
g_signal_handler_block(recordWidget_, recordButtonConnId_);
gtk_action_set_sensitive(hangUpAction_, TRUE);
gtk_action_set_sensitive(recordAction_, TRUE);
gtk_action_set_sensitive(muteAction_, TRUE);
gtk_widget_set_sensitive(holdMenu_, TRUE);
gtk_widget_set_sensitive(holdToolbar_, TRUE);
gtk_widget_set_sensitive(transferToolbar_, TRUE);
gtk_widget_set_sensitive(muteWidget_, TRUE);
if (instant_messaging_enabled)
gtk_action_set_sensitive(imAction_, TRUE);
pos = 1;
add_to_toolbar(toolbar_, hangUpWidget_, pos++);
add_to_toolbar(toolbar_, holdToolbar_, pos++);
add_to_toolbar(toolbar_, transferToolbar_, pos++);
add_to_toolbar(toolbar_, recordWidget_, pos++);
add_to_toolbar(toolbar_, muteWidget_, pos++);
if (instant_messaging_enabled) {
add_to_toolbar(toolbar_, imToolbar_, pos++);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), FALSE);
g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
break;
}
case CALL_STATE_RECORD:
{
DEBUG("Call State Record");
g_signal_handler_block(transferToolbar_, transferButtonConnId_);
g_signal_handler_block(recordWidget_, recordButtonConnId_);
gtk_action_set_sensitive(hangUpAction_, TRUE);
gtk_action_set_sensitive(recordAction_, TRUE);
gtk_action_set_sensitive(muteAction_, TRUE);
......@@ -291,12 +259,13 @@ update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging
add_to_toolbar(toolbar_, imToolbar_, pos++);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), TRUE);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), dbus_get_is_recording(selectedCall));
g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
break;
}
case CALL_STATE_BUSY:
case CALL_STATE_FAILURE:
{
......@@ -328,7 +297,6 @@ update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging
default:
ERROR("Unknown state in action update!");
break;
}
}
}
......@@ -918,7 +886,6 @@ edit_paste(void * foo UNUSED)
}
break;
case CALL_STATE_CURRENT:
case CALL_STATE_RECORD:
default: {
for (unsigned i = 0; i < strlen(no); i++) {
gchar * oneNo = g_strndup(&no[i], 1);
......@@ -1318,7 +1285,6 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
hangup = TRUE;
accounts = TRUE;
break;
case CALL_STATE_RECORD:
case CALL_STATE_CURRENT:
hangup = TRUE;
hold = TRUE;
......
......@@ -210,8 +210,7 @@ im_widget_send_message(const gchar *id, const gchar *message)
dbus_send_text_message(id, message);
else if (im_widget_call) {
if (im_widget_call->_type == CALL && (im_widget_call->_state == CALL_STATE_CURRENT ||
im_widget_call->_state == CALL_STATE_HOLD ||
im_widget_call->_state == CALL_STATE_RECORD)) {
im_widget_call->_state == CALL_STATE_HOLD)) {
/* Ship the message through D-Bus */
dbus_send_text_message(id, message);
} else {
......@@ -326,7 +325,6 @@ call_state_image_widget(call_state_t state)
switch (state) {
case CALL_STATE_CURRENT:
case CALL_STATE_HOLD:
case CALL_STATE_RECORD:
return gtk_image_new_from_stock(GTK_STOCK_IM, GTK_ICON_SIZE_LARGE_TOOLBAR);
default:
return gtk_image_new_from_stock(GTK_STOCK_IM, GTK_ICON_SIZE_LARGE_TOOLBAR);
......
Supports Markdown
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