mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Add name to presence update
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
||||
WAConnectOptions,
|
||||
MediaConnInfo,
|
||||
DEFAULT_ORIGIN,
|
||||
TimedOutError,
|
||||
} from './Constants'
|
||||
import { EventEmitter } from 'events'
|
||||
import KeyedDB from '@adiwajshing/keyed-db'
|
||||
|
||||
@@ -322,7 +322,11 @@ export class WAConnection extends Base {
|
||||
contact.lastSeen = unixTimestampSeconds()
|
||||
}
|
||||
contact.lastKnownPresence = update.type
|
||||
const presence: WAPresenceData = { lastKnownPresence: contact.lastKnownPresence, lastSeen: contact.lastSeen }
|
||||
const presence: WAPresenceData = {
|
||||
lastKnownPresence: contact.lastKnownPresence,
|
||||
lastSeen: contact.lastSeen,
|
||||
name: contact.name || contact.vname || contact.notify
|
||||
}
|
||||
|
||||
const chat = this.chats.get(chatId)
|
||||
if (chat) {
|
||||
|
||||
@@ -180,6 +180,7 @@ export interface WAGroupModification {
|
||||
export interface WAPresenceData {
|
||||
lastKnownPresence?: Presence
|
||||
lastSeen?: number
|
||||
name?: string
|
||||
}
|
||||
export interface WAContact extends WAPresenceData {
|
||||
verify?: string
|
||||
|
||||
Reference in New Issue
Block a user