def get_unread_messages():
 return frappe.db.sql(u" DCTB  DCTB SELECT count(*)\n DCTB  DCTB FROM `tabCommunication`\n DCTB  DCTB WHERE communication_type in ('Chat', 'Notification')\n DCTB  DCTB AND reference_doctype = 'User'\n DCTB  DCTB AND reference_name = %s\n DCTB  DCTB and modified >= DATE_SUB(NOW(),INTERVAL 1 YEAR)\n DCTB  DCTB AND seen=0\n DCTB  DCTB ", (frappe.session.user,))[0][0]

def get_unread_messages ( ) : return frappe . db . sql ( u" DCTB  DCTB SELECT count(*)\n DCTB  DCTB FROM `tabCommunication`\n DCTB  DCTB WHERE communication_type in ('Chat', 'Notification')\n DCTB  DCTB AND reference_doctype = 'User'\n DCTB  DCTB AND reference_name = %s\n DCTB  DCTB and modified >= DATE_SUB(NOW(),INTERVAL 1 YEAR)\n DCTB  DCTB AND seen=0\n DCTB  DCTB " , ( frappe . session . user , ) ) [ 0 ] [ 0 ]
returns unread .