@@ -18,6 +18,7 @@ pub(super) struct NotifyZulipInput {
18
18
}
19
19
20
20
pub ( super ) enum NotificationType {
21
+ Open ,
21
22
Labeled ,
22
23
Unlabeled ,
23
24
Closed ,
@@ -45,8 +46,8 @@ pub(super) async fn parse_input(
45
46
} )
46
47
. map ( |input| vec ! [ input] ) )
47
48
}
48
- IssuesAction :: Closed | IssuesAction :: Reopened => {
49
- Ok ( Some ( parse_close_reopen_input ( event, config) ) )
49
+ IssuesAction :: Opened | IssuesAction :: Closed | IssuesAction :: Reopened => {
50
+ Ok ( Some ( parse_open_close_reopen_input ( event, config) ) )
50
51
}
51
52
_ => Ok ( None ) ,
52
53
}
@@ -93,7 +94,7 @@ fn parse_label_change_input(
93
94
}
94
95
}
95
96
96
- fn parse_close_reopen_input (
97
+ fn parse_open_close_reopen_input (
97
98
event : & IssuesEvent ,
98
99
global_config : & NotifyZulipConfig ,
99
100
) -> Vec < NotifyZulipInput > {
@@ -114,6 +115,9 @@ fn parse_close_reopen_input(
114
115
for ( name, label_config) in & config. subtables {
115
116
if has_all_required_labels ( & event. issue , & label_config) {
116
117
match event. action {
118
+ IssuesAction :: Opened if !label_config. messages_on_add . is_empty ( ) => {
119
+ include_config_names. push ( name. to_string ( ) ) ;
120
+ }
117
121
IssuesAction :: Closed if !label_config. messages_on_close . is_empty ( ) => {
118
122
include_config_names. push ( name. to_string ( ) ) ;
119
123
}
@@ -131,6 +135,11 @@ fn parse_close_reopen_input(
131
135
}
132
136
133
137
match event. action {
138
+ IssuesAction :: Opened => Some ( NotifyZulipInput {
139
+ notification_type : NotificationType :: Open ,
140
+ label,
141
+ include_config_names,
142
+ } ) ,
134
143
IssuesAction :: Closed => Some ( NotifyZulipInput {
135
144
notification_type : NotificationType :: Closed ,
136
145
label,
@@ -193,7 +202,7 @@ pub(super) async fn handle_input<'a>(
193
202
}
194
203
195
204
let msgs = match input. notification_type {
196
- NotificationType :: Labeled => & config. messages_on_add ,
205
+ NotificationType :: Open | NotificationType :: Labeled => & config. messages_on_add ,
197
206
NotificationType :: Unlabeled => & config. messages_on_remove ,
198
207
NotificationType :: Closed => & config. messages_on_close ,
199
208
NotificationType :: Reopened => & config. messages_on_reopen ,
0 commit comments