Skip to content

Commit

Permalink
KCRO-10: expose the message counts per folder when listing vmboxes (2…
Browse files Browse the repository at this point in the history
…600hz#6314)

When listing the voicemail boxes this adds a new object to each called
"folders" if the vmbox has messages. The object contains two
properties that represent the quantity of messages in the 'new' and
'saved' folders.
  • Loading branch information
k-anderson authored and jamesaimonetti committed Feb 14, 2020
1 parent 5bd842d commit 59e5f92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion applications/crossbar/src/modules/cb_vmboxes.erl
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,11 @@ merge_summary_fold(BoxSummary, CountMap) ->
MsgsArrayCount = kz_json:get_integer_value(?VM_KEY_MESSAGES, BoxSummary, 0),
New = maps:get(?VM_FOLDER_NEW, BoxCountMap, 0),
Saved = maps:get(?VM_FOLDER_SAVED, BoxCountMap, 0),
kz_json:set_value(?VM_KEY_MESSAGES, MsgsArrayCount + New + Saved, BoxSummary)
Summary = [{?VM_KEY_MESSAGES, MsgsArrayCount + New + Saved}
,{[<<"folders">>, ?VM_FOLDER_NEW], New}
,{[<<"folders">>, ?VM_FOLDER_SAVED], Saved}
],
kz_json:set_values(Summary, BoxSummary)
end.

%%------------------------------------------------------------------------------
Expand Down

0 comments on commit 59e5f92

Please sign in to comment.