hoehermann / purple-gowhatsapp

Pidgin/libpurple plug-in for WhatsApp Web.
GNU General Public License v3.0
287 stars 35 forks source link

[whatsmeow] Images from me are handled as images from other party #106

Closed vitalyster closed 2 years ago

vitalyster commented 2 years ago
351223: 2022-02-14 10:34:57,610 INFO  libpurple: whatsmeow:[Handler] Received message: &events.Message{Info:types.MessageInfo{MessageSource:types.MessageSource{Chat:types.JID{User:"YYYY", Agent:0x0, Device:0x0, Server:"s.whatsapp.net", AD:false}, Sender:types.JID{User:"XXXX", Agent:0x0, Device:0x7, Server:"s.whatsapp.net", AD:true}, IsFromMe:true, IsGroup:false, BroadcastListOwner:types.JID{User:"", Agent:0x0, Device:0x0, Server:"", AD:false}}, ID:"3EB00C0B3C401304DFD9", Type:"", PushName:"Vitaly", Timestamp:time.Date(2022, time.February, 14, 10, 34, 57, 0, time.Local), Category:"", DeviceSentMeta:(*types.DeviceSentMeta)(0xc000198780)}, Message:(*proto.Message)(0xc0000aef20), IsEphemeral:false, IsViewOnce:false, RawMessage:(*proto.Message)(0xc0000aec60)}
351223: 2022-02-14 10:34:57,610 INFO  libpurple: whatsmeow:[Handler] Received a message without any text.
351223: 2022-02-14 10:34:57,907 INFO  libpurple: whatsmeow:recieved attachment (subtype 1) for account 0x55c670528120 remote YYYY@s.whatsapp.net (isGroup 0) sender XXXX@s.whatsapp.net (alias 9926d005d01f7df04079d0d06934ece9713d5c04d9e11932f5811a208d263050.jpe, fromMe 0) sent 0: (null)

if I understand correctly, the message received with correct IsFromMe:true flag from whatsmeow, but later it was processed with "fromMe 0" and then I receive it in conv_write_im handler with incorrect flags (0x1002, PURPLE_MESSAGE_IMAGES + PURPLE_MESSAGE_RECV) while it should be PURPLE_MESSAGE_SEND