mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-05-04 03:13:35 +00:00
Bug fix on missing sender in group chats #67
This commit is contained in:
@@ -15,7 +15,7 @@ from base64 import b64decode, b64encode
|
|||||||
from Whatsapp_Chat_Exporter.data_model import ChatStore, Message
|
from Whatsapp_Chat_Exporter.data_model import ChatStore, Message
|
||||||
from Whatsapp_Chat_Exporter.utility import MAX_SIZE, ROW_SIZE, determine_metadata, get_status_location
|
from Whatsapp_Chat_Exporter.utility import MAX_SIZE, ROW_SIZE, determine_metadata, get_status_location
|
||||||
from Whatsapp_Chat_Exporter.utility import rendering, Crypt, Device, get_file_name, setup_template
|
from Whatsapp_Chat_Exporter.utility import rendering, Crypt, Device, get_file_name, setup_template
|
||||||
from Whatsapp_Chat_Exporter.utility import brute_force_offset, CRYPT14_OFFSETS
|
from Whatsapp_Chat_Exporter.utility import brute_force_offset, CRYPT14_OFFSETS, JidType
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import zlib
|
import zlib
|
||||||
@@ -197,7 +197,8 @@ def messages(db, data, media_folder):
|
|||||||
message_system.action_type,
|
message_system.action_type,
|
||||||
message_system_group.is_me_joined,
|
message_system_group.is_me_joined,
|
||||||
jid_old.raw_string as old_jid,
|
jid_old.raw_string as old_jid,
|
||||||
jid_new.raw_string as new_jid
|
jid_new.raw_string as new_jid,
|
||||||
|
jid_global.type as jid_type,
|
||||||
FROM messages
|
FROM messages
|
||||||
LEFT JOIN messages_quotes
|
LEFT JOIN messages_quotes
|
||||||
ON messages.quoted_row_id = messages_quotes._id
|
ON messages.quoted_row_id = messages_quotes._id
|
||||||
@@ -243,7 +244,8 @@ def messages(db, data, media_folder):
|
|||||||
message_system.action_type,
|
message_system.action_type,
|
||||||
message_system_group.is_me_joined,
|
message_system_group.is_me_joined,
|
||||||
jid_old.raw_string as old_jid,
|
jid_old.raw_string as old_jid,
|
||||||
jid_new.raw_string as new_jid
|
jid_new.raw_string as new_jid,
|
||||||
|
jid_global.type as jid_type,
|
||||||
FROM message
|
FROM message
|
||||||
LEFT JOIN message_quoted
|
LEFT JOIN message_quoted
|
||||||
ON message_quoted.message_row_id = message._id
|
ON message_quoted.message_row_id = message._id
|
||||||
@@ -315,7 +317,7 @@ def messages(db, data, media_folder):
|
|||||||
i += 1
|
i += 1
|
||||||
content = c.fetchone()
|
content = c.fetchone()
|
||||||
continue
|
continue
|
||||||
if (content["chat_subject"] is not None or "-" in content["key_remote_jid"]) and content["key_from_me"] == 0:
|
if content["jid_type"] == JidType.GROUP and content["key_from_me"] == 0:
|
||||||
name = fallback = None
|
name = fallback = None
|
||||||
if table_message:
|
if table_message:
|
||||||
if content["sender_jid_row_id"] > 0:
|
if content["sender_jid_row_id"] > 0:
|
||||||
|
|||||||
@@ -7,13 +7,15 @@ from datetime import datetime
|
|||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from Whatsapp_Chat_Exporter.data_model import ChatStore
|
from Whatsapp_Chat_Exporter.data_model import ChatStore
|
||||||
try:
|
try:
|
||||||
from enum import StrEnum
|
from enum import StrEnum, IntEnum
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# < Python 3.11
|
# < Python 3.11
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
class StrEnum(str, Enum):
|
class StrEnum(str, Enum):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class IntEnum(int, Enum):
|
||||||
|
pass
|
||||||
|
|
||||||
MAX_SIZE = 4 * 1024 * 1024 # Default 4MB
|
MAX_SIZE = 4 * 1024 * 1024 # Default 4MB
|
||||||
ROW_SIZE = 0x3D0
|
ROW_SIZE = 0x3D0
|
||||||
@@ -302,3 +304,9 @@ class WhatsAppBusinessIdentifier(StrEnum):
|
|||||||
MESSAGE = "724bd3b98b18518b455a87c1f3ac3a0d189c4466"
|
MESSAGE = "724bd3b98b18518b455a87c1f3ac3a0d189c4466"
|
||||||
CONTACT = "d7246a707f51ddf8b17ee2dddabd9e0a4da5c552"
|
CONTACT = "d7246a707f51ddf8b17ee2dddabd9e0a4da5c552"
|
||||||
DOMAIN = "AppDomainGroup-group.net.whatsapp.WhatsAppSMB.shared"
|
DOMAIN = "AppDomainGroup-group.net.whatsapp.WhatsAppSMB.shared"
|
||||||
|
|
||||||
|
class JidType(IntEnum):
|
||||||
|
PM = 0
|
||||||
|
GROUP = 1
|
||||||
|
SYSTEM_BROADCAST = 5
|
||||||
|
STATUS = 11
|
||||||
|
|||||||
Reference in New Issue
Block a user