Page MenuHomePhorge

D429.1775935714.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D429.1775935714.diff

diff --git a/apps/kolab_guam/src/rules/kolab_guam_rule_filter_groupware.erl b/apps/kolab_guam/src/rules/kolab_guam_rule_filter_groupware.erl
--- a/apps/kolab_guam/src/rules/kolab_guam_rule_filter_groupware.erl
+++ b/apps/kolab_guam/src/rules/kolab_guam_rule_filter_groupware.erl
@@ -77,6 +77,11 @@
apply_if_found_kolab(0) -> true;
apply_if_found_kolab(_) -> false.
+return_if_not_empty(<<>>, More, State, LastChunk) ->
+ { <<>>, State#state { active = More, last_chunk = LastChunk } };
+return_if_not_empty(Response, More, State, LastChunk) ->
+ { <<Response/binary, "\r\n">>, State#state { active = More, last_chunk = LastChunk } }.
+
filter_folders(<<>>, State) ->
{ <<>>, State#state{ active = true } };
filter_folders(Buffer, #state{ last_chunk = LeftOvers } = State) ->
@@ -85,7 +90,7 @@
ListResponses = binary:split(FullLinesBuffer, <<"\r\n">>, [ global ]),
{ Response, More } = filter_folders(State, ListResponses, { <<>>, true }),
%io:format("Filtered ... ~p~n", [Response]),
- { <<Response/binary, "\r\n">>, State#state { active = More, last_chunk = LastChunk } }.
+ return_if_not_empty(Response, More, State, LastChunk).
filter_folders(_State, [], Return) -> Return;
filter_folders(_State, _Folders, { Acc, false }) -> { Acc, false };
diff --git a/apps/kolab_guam/test/kolab_guam_rules_SUITE.erl b/apps/kolab_guam/test/kolab_guam_rules_SUITE.erl
--- a/apps/kolab_guam/test/kolab_guam_rules_SUITE.erl
+++ b/apps/kolab_guam/test/kolab_guam_rules_SUITE.erl
@@ -113,6 +113,17 @@
<<"\"/\" Notes\r\n* LIST (\\Subscribed) \"/\" Sent\r\n* LIST (\\Subscribed) \"/\" Spam\r\n* LIST (\\Subscribed) \"/\" Tasks\r\n* LIST (\\Subscribed) \"/\" Trash\r\n7 OK Completed (0.000 secs 15 calls)\r\n">>
],
<<"* LIST (\\Noinferiors \\Subscribed) \"/\" INBOX\r\n* LIST (\\Subscribed) \"/\" Archive\r\n* LIST (\\Subscribed) \"/\" Drafts\r\n* LIST (\\Subscribed) \"/\" Sent\r\n* LIST (\\Subscribed) \"/\" Spam\r\n* LIST (\\Subscribed) \"/\" Trash\r\n7 OK Completed (0.000 secs 15 calls)\r\n">>
+ },
+ %Filter complete packet
+ {
+ [
+ {<<"Calendar">>, <<"Calendar/">>}
+ ],
+ [
+ <<"* LIST (\\Subscribed \\HasChildren) \"/\" Calendar\r\n">>,
+ <<"7 OK Completed (0.000 secs 15 calls)\r\n">>
+ ],
+ <<"7 OK Completed (0.000 secs 15 calls)\r\n">>
}
],
%% setup boilerplate

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 11, 7:28 PM (11 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18861128
Default Alt Text
D429.1775935714.diff (2 KB)

Event Timeline