合入家庭共享与设备消息能力
This commit is contained in:
@@ -489,6 +489,27 @@ class TalkingQMQTTService:
|
||||
await offline_audio_cache.clear_audio_urls(device_id)
|
||||
return
|
||||
|
||||
latest_item = await pending_voice_message_service.get_latest_history_playback_item(
|
||||
target_device_id=device_id,
|
||||
)
|
||||
if latest_item:
|
||||
payload = {
|
||||
"msg_id": "005",
|
||||
"type": 0,
|
||||
"params": {"url_1": latest_item.audio_url},
|
||||
}
|
||||
await self._publish(topic, payload)
|
||||
logger.info(
|
||||
device_id,
|
||||
"pending_voice",
|
||||
(
|
||||
"待收听队列为空,回放最近历史留言: "
|
||||
f"im_message_id={latest_item.im_message_id}, "
|
||||
f"media_file_key={latest_item.media_file_key}"
|
||||
),
|
||||
)
|
||||
return
|
||||
|
||||
audio_urls = await offline_audio_cache.pop_audio_urls(device_id)
|
||||
if audio_urls:
|
||||
params = {f"url_{k}": audio_url for k, audio_url in enumerate(audio_urls, start=1)}
|
||||
|
||||
Reference in New Issue
Block a user