Changeset View
Changeset View
Standalone View
Standalone View
apps/kolab_guam/src/rules/kolab_guam_rule_filter_groupware.erl
Show All 39 Lines | apply_to_client_message(ImapSession, Buffer, State) -> | ||||
end, | end, | ||||
%lager:info("Client sent: ~s ~s ~p", [Command, Data, Active]), | %lager:info("Client sent: ~s ~s ~p", [Command, Data, Active]), | ||||
{ Buffer, State#state{ active = Active, tag = StateTag }}. | { Buffer, State#state{ active = Active, tag = StateTag }}. | ||||
apply_to_server_message(_ImapSession, Buffer, #state{ active = true } = State) -> | apply_to_server_message(_ImapSession, Buffer, #state{ active = true } = State) -> | ||||
filter_folders(Buffer, State); | filter_folders(Buffer, State); | ||||
apply_to_server_message(_ImapSession, Buffer, State) -> { Buffer, State }. | apply_to_server_message(_ImapSession, Buffer, State) -> { Buffer, State }. | ||||
imap_data(blacklist, { error, _Reason }, State) -> State; | |||||
imap_data(blacklist, Response, State) -> | imap_data(blacklist, Response, State) -> | ||||
%TODO: we don't need Foo/Bar if we already have Foo, so filter folders-of-groupwarefolders | %TODO: we don't need Foo/Bar if we already have Foo, so filter folders-of-groupwarefolders | ||||
Blacklist = lists:foldl(fun({ _Folder, [ { _Property, null } ]}, Acc) -> Acc; | Blacklist = lists:foldl(fun({ _Folder, [ { _Property, null } ]}, Acc) -> Acc; | ||||
({ _Folder, [ { _Property, <<"mail", _Rest/binary>> } ]}, Acc) -> Acc; | ({ _Folder, [ { _Property, <<"mail", _Rest/binary>> } ]}, Acc) -> Acc; | ||||
({ Folder, _ }, Acc) -> [{ Folder, <<Folder/binary, "/">> }|Acc] end, | ({ Folder, _ }, Acc) -> [{ Folder, <<Folder/binary, "/">> }|Acc] end, | ||||
[], Response), | [], Response), | ||||
State#state{ blacklist = Blacklist }. | State#state{ blacklist = Blacklist }. | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |