mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 19:02:17 +08:00
增加分享卡片的logo链接
This commit is contained in:
parent
b711a2048b
commit
286127bae2
@ -241,7 +241,7 @@ class HtmlExporter(ExporterBase):
|
|||||||
shutil.copy(app_logo, os.path.join(origin_docx_path, 'image', os.path.basename(app_logo)))
|
shutil.copy(app_logo, os.path.join(origin_docx_path, 'image', os.path.basename(app_logo)))
|
||||||
app_logo = './image/' + os.path.basename(app_logo)
|
app_logo = './image/' + os.path.basename(app_logo)
|
||||||
else:
|
else:
|
||||||
app_logo = ''
|
app_logo = card_data.get('app_logo')
|
||||||
doc.write(
|
doc.write(
|
||||||
f'''{{ type:49,sub_type:5, text:'',is_send:{is_send},avatar_path:'{avatar}',url:'{card_data.get('url')}',
|
f'''{{ type:49,sub_type:5, text:'',is_send:{is_send},avatar_path:'{avatar}',url:'{card_data.get('url')}',
|
||||||
timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}',title:'{card_data.get('title')}',
|
timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}',title:'{card_data.get('title')}',
|
||||||
|
@ -106,7 +106,7 @@ class ExportDialog(QDialog):
|
|||||||
|
|
||||||
def set_total_msg_num(self, num):
|
def set_total_msg_num(self, num):
|
||||||
self.total_msg_num = num
|
self.total_msg_num = num
|
||||||
b''+num +(1,1)
|
# b''+num +(1,1)
|
||||||
|
|
||||||
def export_finished(self):
|
def export_finished(self):
|
||||||
self.export_button.setEnabled(True)
|
self.export_button.setEnabled(True)
|
||||||
|
@ -140,6 +140,7 @@ def share_card(bytesExtra, compress_content_):
|
|||||||
url = appmsg.find('url').text
|
url = appmsg.find('url').text
|
||||||
appinfo = root.find('appinfo')
|
appinfo = root.find('appinfo')
|
||||||
show_display_name = appmsg.find('sourcedisplayname')
|
show_display_name = appmsg.find('sourcedisplayname')
|
||||||
|
sourceusername = appmsg.find('sourceusername')
|
||||||
if show_display_name is not None:
|
if show_display_name is not None:
|
||||||
show_display_name = show_display_name.text
|
show_display_name = show_display_name.text
|
||||||
else:
|
else:
|
||||||
@ -155,6 +156,11 @@ def share_card(bytesExtra, compress_content_):
|
|||||||
if msginfo[1][1][1] == 4:
|
if msginfo[1][1][1] == 4:
|
||||||
app_logo = msginfo[1][2][1]
|
app_logo = msginfo[1][2][1]
|
||||||
app_logo = "\\".join(app_logo.split('\\')[1:])
|
app_logo = "\\".join(app_logo.split('\\')[1:])
|
||||||
|
if sourceusername is not None:
|
||||||
|
from app.DataBase import micro_msg_db # 放上面会导致循环依赖
|
||||||
|
contact = micro_msg_db.get_contact_by_username(sourceusername.text)
|
||||||
|
if contact:
|
||||||
|
app_logo = contact[7]
|
||||||
return {
|
return {
|
||||||
'title': escape_js_and_html(title),
|
'title': escape_js_and_html(title),
|
||||||
'description': escape_js_and_html(des),
|
'description': escape_js_and_html(des),
|
||||||
|
Loading…
Reference in New Issue
Block a user