@@ -116,24 +116,25 @@ impl QQNotifier {
116116 }
117117
118118 fn wrap_item ( notifier : & Notifier , source : & str , item : & Item ) -> Vec < Message > {
119- vec ! [
120- Message {
121- msg_type: "node" . to_string( ) ,
122- data: Data {
123- sender_name: notifier. conf. name. clone( ) ,
124- sender_uin: notifier. conf. uin. clone( ) ,
125- content: format!( "{}:\n {} ({})" , source, item. title, item. pub_date) ,
126- } ,
119+ let mut messages = vec ! [ Message {
120+ msg_type: "node" . to_string( ) ,
121+ data: Data {
122+ sender_name: notifier. conf. name. clone( ) ,
123+ sender_uin: notifier. conf. uin. clone( ) ,
124+ content: format!( "{}:\n {} ({})" , source, item. title, item. pub_date) ,
127125 } ,
128- Message {
126+ } ] ;
127+ if notifier. conf . with_torrent {
128+ messages. push ( Message {
129129 msg_type : "node" . to_string ( ) ,
130130 data : Data {
131131 sender_name : notifier. conf . name . clone ( ) ,
132132 sender_uin : notifier. conf . uin . clone ( ) ,
133133 content : item. url . clone ( ) ,
134134 } ,
135- } ,
136- ]
135+ } ) ;
136+ }
137+ messages
137138 }
138139
139140 async fn send_private_msg ( notifier : & Notifier , msg : Vec < Message > ) -> Result < ( ) > {
0 commit comments