@tiledesk/tiledesk-server 2.3.5 → 2.3.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -202,20 +202,14 @@ router.post('/', function (req, res) {
|
|
202
202
|
}
|
203
203
|
|
204
204
|
|
205
|
-
|
206
|
-
|
207
|
-
// // qui projecy nn c'è devi leggerlo
|
208
|
-
// if (req.project.attributes.auto_close === false) {
|
209
|
-
// auto_close = 10;
|
210
|
-
// }
|
211
|
-
|
205
|
+
|
212
206
|
|
213
207
|
var new_request = {
|
214
208
|
request_id: message.recipient, project_user_id:project_user_id, lead_id:createdLead._id, id_project:projectid, first_text:message.text,
|
215
209
|
departmentid:departmentid, sourcePage:sourcePage, language:language, userAgent:client, status:requestStatus, createdBy: undefined,
|
216
210
|
attributes:rAttributes, subject:undefined, preflight:false, channel:undefined, location:undefined,
|
217
211
|
lead:createdLead, requester:project_user
|
218
|
-
|
212
|
+
|
219
213
|
};
|
220
214
|
|
221
215
|
winston.debug("new_request", new_request);
|
@@ -543,9 +537,9 @@ router.post('/', function (req, res) {
|
|
543
537
|
});
|
544
538
|
}
|
545
539
|
|
546
|
-
else if (req.body.event_type == "deleted-archivedconversation") {
|
540
|
+
else if (req.body.event_type == "deleted-archivedconversation" || req.body.event_type == "conversation-unarchived") {
|
547
541
|
|
548
|
-
winston.
|
542
|
+
winston.info("event_type","deleted-archivedconversation");
|
549
543
|
|
550
544
|
winston.debug("req.body",req.body);
|
551
545
|
|
@@ -559,21 +553,21 @@ router.post('/', function (req, res) {
|
|
559
553
|
// winston.debug("conversation",conversation);
|
560
554
|
|
561
555
|
var user_id = req.body.user_id;
|
562
|
-
winston.
|
556
|
+
winston.info("user_id",user_id);
|
563
557
|
|
564
558
|
var recipient_id = req.body.recipient_id;
|
565
|
-
winston.
|
559
|
+
winston.info("recipient_id",recipient_id);
|
566
560
|
|
567
561
|
|
568
562
|
// TODO leggi projectid from support-group
|
569
563
|
|
570
564
|
if (!recipient_id.startsWith("support-group")){
|
571
|
-
winston.
|
565
|
+
winston.info("not a support conversation");
|
572
566
|
return res.status(400).send({success: false, msg: "not a support conversation" });
|
573
567
|
}
|
574
568
|
|
575
569
|
if (user_id!="system"){
|
576
|
-
winston.
|
570
|
+
winston.info("not a system conversation");
|
577
571
|
return res.status(400).send({success: false, msg: "not a system conversation" });
|
578
572
|
}
|
579
573
|
|
@@ -582,9 +576,10 @@ router.post('/', function (req, res) {
|
|
582
576
|
if (conversation && conversation.attributes) {
|
583
577
|
id_project = conversation.attributes.projectId;
|
584
578
|
}else {
|
579
|
+
winston.info( "not a support deleting archived conversation" );
|
585
580
|
return res.status(400).send({success: false, msg: "not a support deleting archived conversation" });
|
586
581
|
}
|
587
|
-
winston.
|
582
|
+
winston.info("id_project", id_project);
|
588
583
|
|
589
584
|
|
590
585
|
return requestService.reopenRequestByRequestId(recipient_id, id_project).then(function(updatedRequest) {
|
package/package.json
CHANGED
@@ -188,7 +188,7 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
|
|
188
188
|
|
189
189
|
setImmediate(() => {
|
190
190
|
|
191
|
-
winston.debug("ConciergeBot send close bot message");
|
191
|
+
winston.debug("ConciergeBot send close bot message",request);
|
192
192
|
|
193
193
|
// send(sender, senderFullname, recipient, text, id_project, createdBy, attributes, type, metadata, language)
|
194
194
|
messageService.send(
|
@@ -198,7 +198,7 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
|
|
198
198
|
"Chat closed",
|
199
199
|
request.id_project,
|
200
200
|
'system',
|
201
|
-
{subtype:"info/support", "updateconversation" : false, messagelabel: {key: "CHAT_CLOSED"}},
|
201
|
+
{subtype:"info/support", "updateconversation" : false, messagelabel: {key: "CHAT_CLOSED"}},
|
202
202
|
undefined,
|
203
203
|
request.language
|
204
204
|
);
|
@@ -228,8 +228,8 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
|
|
228
228
|
request.request_id,
|
229
229
|
"Chat reopened",
|
230
230
|
request.id_project,
|
231
|
-
'system',
|
232
|
-
{subtype:"info/support", "updateconversation" :
|
231
|
+
'system',
|
232
|
+
{subtype:"info/support", "updateconversation" : true, messagelabel: {key: "CHAT_REOPENED"}},
|
233
233
|
undefined,
|
234
234
|
request.language
|
235
235
|
|