diff --git a/src/commands/eimap_command_getmetadata.erl b/src/commands/eimap_command_getmetadata.erl --- a/src/commands/eimap_command_getmetadata.erl +++ b/src/commands/eimap_command_getmetadata.erl @@ -29,7 +29,7 @@ AttributesString = format_attributes(Attributes, <<>>), DepthString = depth_param(Depth), MaxSizeString = maxsize_param(MaxSize), - Command = metadata_comand(DepthString, MaxSizeString, Folder, AttributesString), + Command = metadata_command(DepthString, MaxSizeString, Folder, AttributesString), { Command, multiline_response }. process_line(<<"* METADATA ", Details/binary>>, Acc) -> @@ -47,10 +47,10 @@ maxsize_param(Size) when is_integer(Size) -> Bin = integer_to_binary(Size), <<"MAXSIZE ", Bin/binary>>; maxsize_param(_) -> <<>>. -metadata_comand(<<>>, <<>>, Folder, Attributes) -> <<"GETMETADATA \"", Folder/binary, "\"", Attributes/binary>>; -metadata_comand(Depth, <<>>, Folder, Attributes) -> <<"GETMETADATA (", Depth/binary, ") \"", Folder/binary, "\"", Attributes/binary>>; -metadata_comand(<<>>, MaxSize, Folder, Attributes) -> <<"GETMETADATA (", MaxSize/binary, ") \"", Folder/binary, "\"", Attributes/binary>>; -metadata_comand(Depth, MaxSize, Folder, Attributes) -> <<"GETMETADATA (", Depth/binary, " ", MaxSize/binary, ") \"", Folder/binary, "\"", Attributes/binary>>. +metadata_command(<<>>, <<>>, Folder, Attributes) -> <<"GETMETADATA \"", Folder/binary, "\"", Attributes/binary>>; +metadata_command(Depth, <<>>, Folder, Attributes) -> <<"GETMETADATA (", Depth/binary, ") \"", Folder/binary, "\"", Attributes/binary>>; +metadata_command(<<>>, MaxSize, Folder, Attributes) -> <<"GETMETADATA (", MaxSize/binary, ") \"", Folder/binary, "\"", Attributes/binary>>; +metadata_command(Depth, MaxSize, Folder, Attributes) -> <<"GETMETADATA (", Depth/binary, " ", MaxSize/binary, ") \"", Folder/binary, "\"", Attributes/binary>>. format_attributes([], <<>>) -> <<>>; format_attributes([], String) -> <<" (", String/binary, ")">>;