diff options
author | Rémy Coutable <remy@rymai.me> | 2016-08-10 15:12:09 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-08-13 01:06:12 +0300 |
commit | 23db6449542498636c145e83c71a4a466eb62746 (patch) | |
tree | 34619a5bccfe7864c29abfefc61268b5da86d35a /app/services/slash_commands | |
parent | e021604454f1093b7d762b28eae36e30083f0053 (diff) |
Add support for no-op slash commands that appear in autocomplete
The first one is /cc
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/services/slash_commands')
-rw-r--r-- | app/services/slash_commands/interpret_service.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/slash_commands/interpret_service.rb b/app/services/slash_commands/interpret_service.rb index 3030af05999..55b14f118d0 100644 --- a/app/services/slash_commands/interpret_service.rb +++ b/app/services/slash_commands/interpret_service.rb @@ -117,7 +117,7 @@ module SlashCommands return unless noteable.respond_to?(:due_date) due_date = begin - if due_date_param.downcase == 'tomorrow' + if due_date_param.casecmp('tomorrow').zero? Date.tomorrow else Time.now + ChronicDuration.parse(due_date_param) @@ -136,6 +136,14 @@ module SlashCommands @updates[:due_date] = nil end + # This is a dummy command, so that it appears in the autocomplete commands + desc 'CC' + params '@user' + noop true + command :cc do + return + end + def find_label_ids(labels_param) extract_references(labels_param, :label).map(&:id) end |