Closed msiena closed 3 years ago
on message.py change like this def factory_message(js_obj, driver): """Factory function for creating appropriate object given selenium JS object""" if js_obj is None: return
if "lat" in js_obj and "lng" in js_obj and js_obj["lat"] and js_obj["lng"]:
return GeoMessage(js_obj, driver)
if js_obj["isMedia"] or js_obj["type"] == 'document':
return MediaMessage(js_obj, driver)
if js_obj["isNotification"]:
return NotificationMessage(js_obj, driver)
if "isMMS" in js_obj and js_obj["isMMS"]:
return MMSMessage(js_obj, driver)
if js_obj["type"] in ["vcard", "multi_vcard"]:
return VCardMessage(js_obj, driver)
return Message(js_obj, driver)
if js_obj["isMedia"] or js_obj["type"] == 'document' or js_obj["type"] == 'ptt': return MediaMessage(js_obj, driver)
on message.py change like this def factory_message(js_obj, driver): """Factory function for creating appropriate object given selenium JS object""" if js_obj is None: return
if "lat" in js_obj and "lng" in js_obj and js_obj["lat"] and js_obj["lng"]: return GeoMessage(js_obj, driver) if js_obj["isMedia"] or js_obj["type"] == 'document': return MediaMessage(js_obj, driver) if js_obj["isNotification"]: return NotificationMessage(js_obj, driver) if "isMMS" in js_obj and js_obj["isMMS"]: return MMSMessage(js_obj, driver) if js_obj["type"] in ["vcard", "multi_vcard"]: return VCardMessage(js_obj, driver) return Message(js_obj, driver)
Tank you for answering. Your instruction solved the PDF problem.
if js_obj["isMedia"] or js_obj["type"] == 'document' or js_obj["type"] == 'ptt': return MediaMessage(js_obj, driver)
Thank you. With it complement the PTT problem was solved.
The get_unread() function is no longer receiving messages from documents (PDF) and also from audio (PTT). The messages are simply ignored.