mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
refactor: move processMessage out of socket
This commit is contained in:
@@ -253,4 +253,19 @@ export const fetchLatestBaileysVersion = async() => {
|
||||
error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const STATUS_MAP: { [_: string]: proto.WebMessageInfo.WebMessageInfoStatus } = {
|
||||
'played': proto.WebMessageInfo.WebMessageInfoStatus.PLAYED,
|
||||
'read': proto.WebMessageInfo.WebMessageInfoStatus.READ,
|
||||
'read-self': proto.WebMessageInfo.WebMessageInfoStatus.READ
|
||||
}
|
||||
|
||||
export const getStatusFromReceiptType = (type: string | undefined) => {
|
||||
const status = STATUS_MAP[type]
|
||||
if(typeof type === 'undefined') {
|
||||
return proto.WebMessageInfo.WebMessageInfoStatus.DELIVERY_ACK
|
||||
}
|
||||
|
||||
return status
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user