Compare commits
No commits in common. "b9f8bfc8d50fa65c9d163ce8c288be076bee3d63" and "e1e10d8226d82674cba4a822e55cf3f928424964" have entirely different histories.
b9f8bfc8d5
...
e1e10d8226
|
@ -885,15 +885,11 @@ async function handleMessage(msg) {
|
|||
|
||||
if (msg.fromMe) {
|
||||
|
||||
console.log('MSG FROM ME')
|
||||
|
||||
msgContact = await client.getContactById(msg.to)
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
console.log('MSG FROM CLIENT')
|
||||
|
||||
console.log('################# RECEIVING MESSAGE FROM: ', msg.from, ' to ', msg.to)
|
||||
|
||||
msgContact = await msg.getContact()
|
||||
|
@ -916,10 +912,10 @@ async function handleMessage(msg) {
|
|||
msgContact: msgContact,
|
||||
chat: chat,
|
||||
quotedMsg: quotedMsg ? quotedMsg.id.id : null,
|
||||
media: media,
|
||||
getContactById: msg.fromMe ? await client.getContactById(msg.to) : await client.getContactById(msg.from)
|
||||
media: media
|
||||
}
|
||||
|
||||
|
||||
socketIo.emit("message_create", data)
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ const FindOrCreateTicketService = async (
|
|||
await ticket.update({
|
||||
status: "pending",
|
||||
userId: null,
|
||||
queueId: null,
|
||||
unreadMessages
|
||||
});
|
||||
}
|
||||
|
@ -97,12 +96,7 @@ const FindOrCreateTicketService = async (
|
|||
if (!ticket) {
|
||||
let status = "pending";
|
||||
|
||||
if (
|
||||
queues.length > 1 &&
|
||||
!botInfo.isOnQueue &&
|
||||
!queueId &&
|
||||
!groupContact
|
||||
) {
|
||||
if (queues.length > 1 && !botInfo.isOnQueue && !queueId) {
|
||||
status = "queueChoice";
|
||||
}
|
||||
|
||||
|
|
|
@ -372,12 +372,6 @@ const verifyQueue = async (
|
|||
ticket: Ticket,
|
||||
contact: Contact
|
||||
) => {
|
||||
|
||||
if(ticket?.isGroup){
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
const { queues, greetingMessage } = await ShowWhatsAppService(wbot.id!);
|
||||
|
||||
let selectedOption = null;
|
||||
|
@ -709,7 +703,7 @@ const handleMessage = async (
|
|||
|
||||
try {
|
||||
let msgContact: any = wbot.msgContact;
|
||||
let groupContact: Contact | undefined;
|
||||
// let groupContact: Contact | undefined;
|
||||
|
||||
if (msg.fromMe) {
|
||||
// messages sent automatically by wbot have a special character in front of it
|
||||
|
@ -749,10 +743,7 @@ const handleMessage = async (
|
|||
|
||||
// console.log('----------> chat: ', JSON.parse(JSON.stringify(chat)))
|
||||
|
||||
|
||||
console
|
||||
|
||||
if (chat.isGroup) {
|
||||
// if (chat.isGroup) {
|
||||
// let msgGroupContact;
|
||||
|
||||
// if (msg.fromMe) {
|
||||
|
@ -761,8 +752,8 @@ const handleMessage = async (
|
|||
// msgGroupContact = await wbot.getContactById(msg.from);
|
||||
// }
|
||||
|
||||
groupContact = await verifyContact(wbot.getContactById);
|
||||
}
|
||||
// groupContact = await verifyContact(msgGroupContact);
|
||||
// }
|
||||
|
||||
const whatsapp = await ShowWhatsAppService(wbot.id!);
|
||||
|
||||
|
@ -786,12 +777,12 @@ const handleMessage = async (
|
|||
|
||||
const _botInfo = await BotIsOnQueue("botqueue");
|
||||
|
||||
if (_botInfo.isOnQueue && !chat.isGroup) {
|
||||
if (_botInfo.isOnQueue) {
|
||||
let ticket_obj: any = await FindOrCreateTicketServiceBot(
|
||||
contact,
|
||||
wbot.id!,
|
||||
unreadMessages,
|
||||
groupContact
|
||||
unreadMessages
|
||||
// groupContact
|
||||
);
|
||||
|
||||
ticket = ticket_obj.ticket;
|
||||
|
@ -810,8 +801,8 @@ const handleMessage = async (
|
|||
ticket = await FindOrCreateTicketService(
|
||||
contact,
|
||||
wbot.id!,
|
||||
unreadMessages,
|
||||
groupContact
|
||||
unreadMessages
|
||||
// groupContact
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -387,10 +387,10 @@ const NotificationsPopOver = () => {
|
|||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
classes={{ paper: classes?.popoverPaper }}
|
||||
classes={{ paper: classes.popoverPaper }}
|
||||
onClose={handleClickAway}
|
||||
>
|
||||
<List dense className={classes?.tabContainer}>
|
||||
<List dense className={classes.tabContainer}>
|
||||
{notifications.length === 0 ? (
|
||||
<ListItem>
|
||||
<ListItemText>{i18n.t("notifications.noTickets")}</ListItemText>
|
||||
|
|
|
@ -229,7 +229,7 @@ const TicketListItem = ({ ticket, remoteTicketsControll, settings }) => {
|
|||
variant="body2"
|
||||
color="textPrimary"
|
||||
>
|
||||
{ticket?.contact?.name}
|
||||
{ticket.contact.name}
|
||||
</Typography>
|
||||
{ticket.status === "closed" && (
|
||||
<Badge
|
||||
|
|
Loading…
Reference in New Issue