From ea1b26fbfce5f8506c71572e433a7315ffaabcc5 Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Tue, 5 Sep 2017 13:55:04 +0200 Subject: [PATCH] TT#20322 preliminary fix for failing conversations tests + added conversations to api_root.t + disabled xmpp conversations source, since "soap" MySQL user is not yet granted to prosody.* tables Change-Id: I3d6a9418e7c2b77503f8472fe639e971ad7be3fa --- lib/NGCP/Panel/Role/API/Conversations.pm | 10 +++++++++- t/api-rest/api-root.t | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Role/API/Conversations.pm b/lib/NGCP/Panel/Role/API/Conversations.pm index 31e74f10c8..cf017d05b7 100644 --- a/lib/NGCP/Panel/Role/API/Conversations.pm +++ b/lib/NGCP/Panel/Role/API/Conversations.pm @@ -82,6 +82,14 @@ $max_fields = scalar keys %sms_fields if ((scalar keys %sms_fields) > $max_field $max_fields = scalar keys %fax_fields if ((scalar keys %fax_fields) > $max_fields); $max_fields = scalar keys %xmpp_fields if ((scalar keys %xmpp_fields) > $max_fields); +my %enabled_conversations = ( + call => 1, + voicemail => 1, + sms => 1, + fax => 1, + xmpp => 0, +); + sub item_name{ return 'conversation'; } @@ -150,7 +158,7 @@ sub _item_rs { my $item_rs; my $type_param = ((exists $params->{type}) ? ($params->{type} // '') : undef); foreach my $type (qw(call voicemail sms fax xmpp)) { - if ((not defined $type_param) or index(lc($type_param),$type) > -1) { + if ($enabled_conversations{$type} and ((not defined $type_param) or index(lc($type_param),$type) > -1)) { my $sub_name = '_get_' . $type . '_rs'; my $rs = $self->$sub_name( c => $c, diff --git a/t/api-rest/api-root.t b/t/api-rest/api-root.t index b832b4bf87..ad8bfaccb6 100644 --- a/t/api-rest/api-root.t +++ b/t/api-rest/api-root.t @@ -61,6 +61,7 @@ $ua = Test::Collection->new()->ua(); cfsourcesets => 1, cftimesets => 1, contracts => 1, + conversations => 1, customerbalances => 1, customercontacts => 1, customerfraudevents => 1,