mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-04-24 15:01:36 +00:00
Resize sticker
This commit is contained in:
@@ -62,6 +62,7 @@ class Message():
|
|||||||
self.quoted_data = None
|
self.quoted_data = None
|
||||||
self.caption = None
|
self.caption = None
|
||||||
self.thumb = None # Android specific
|
self.thumb = None # Android specific
|
||||||
|
self.sticker = None
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -351,6 +351,8 @@ def messages(db, data, media_folder):
|
|||||||
invalid = True
|
invalid = True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
if content["media_wa_type"] == 20: # Sticker
|
||||||
|
message.sticker = True
|
||||||
if content["key_from_me"] == 1:
|
if content["key_from_me"] == 1:
|
||||||
if content["status"] == 5 and content["edit_version"] == 7 or table_message and content["message_type"] == 15:
|
if content["status"] == 5 and content["edit_version"] == 7 or table_message and content["message_type"] == 15:
|
||||||
msg = "Message deleted"
|
msg = "Message deleted"
|
||||||
|
|||||||
@@ -129,6 +129,8 @@ def messages(db, data, media_folder):
|
|||||||
quoted = content["ZMETADATA"][2:19]
|
quoted = content["ZMETADATA"][2:19]
|
||||||
message.reply = quoted.decode()
|
message.reply = quoted.decode()
|
||||||
message.quoted_data = None # TODO
|
message.quoted_data = None # TODO
|
||||||
|
if content["ZMESSAGETYPE"] == 15: # Sticker
|
||||||
|
message.sticker = True
|
||||||
|
|
||||||
if content["ZISFROMME"] == 1:
|
if content["ZISFROMME"] == 1:
|
||||||
if content["ZMESSAGETYPE"] == 14:
|
if content["ZMESSAGETYPE"] == 14:
|
||||||
|
|||||||
@@ -82,6 +82,10 @@
|
|||||||
.blue {
|
.blue {
|
||||||
color: #70777a;
|
color: #70777a;
|
||||||
}
|
}
|
||||||
|
.sticker {
|
||||||
|
max-width: 100px !important;
|
||||||
|
max-height: 100px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -128,7 +132,9 @@
|
|||||||
{{ msg.data | sanitize_except() }}
|
{{ msg.data | sanitize_except() }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if "image/" in msg.mime %}
|
{% if "image/" in msg.mime %}
|
||||||
<a href="{{ msg.data }}"><img src="{{ msg.thumb if msg.thumb is not none else msg.data }}" /></a>
|
<a href="{{ msg.data }}">
|
||||||
|
<img src="{{ msg.thumb if msg.thumb is not none else msg.data }}" {{ 'class="sticker"' if msg.sticker }} />
|
||||||
|
</a>
|
||||||
{% elif "audio/" in msg.mime %}
|
{% elif "audio/" in msg.mime %}
|
||||||
<audio controls="controls" autobuffer="autobuffer">
|
<audio controls="controls" autobuffer="autobuffer">
|
||||||
<source src="{{ msg.data }}" />
|
<source src="{{ msg.data }}" />
|
||||||
@@ -206,7 +212,9 @@
|
|||||||
{{ msg.data | sanitize_except() }}
|
{{ msg.data | sanitize_except() }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if "image/" in msg.mime %}
|
{% if "image/" in msg.mime %}
|
||||||
<a href="{{ msg.data }}"><img src="{{ msg.thumb if msg.thumb is not none else msg.data }}" /></a>
|
<a href="{{ msg.data }}">
|
||||||
|
<img src="{{ msg.thumb if msg.thumb is not none else msg.data }}" {{ 'class="sticker"' if msg.sticker }}/>
|
||||||
|
</a>
|
||||||
{% elif "audio/" in msg.mime %}
|
{% elif "audio/" in msg.mime %}
|
||||||
<audio controls preload="auto">
|
<audio controls preload="auto">
|
||||||
<source src="{{ msg.data }}" />
|
<source src="{{ msg.data }}" />
|
||||||
|
|||||||
Reference in New Issue
Block a user