Send an status update for the webxdc instance of this message. If the webxdc instance is a draft, the update is not sent immediately. Instead, the updates are collected and sent out in a batch when the instance is actually sent. :param json_data: program-readable data, the
(self, json_data: Union[str, dict], description: str)
| 143 | ) |
| 144 | |
| 145 | def send_status_update(self, json_data: Union[str, dict], description: str) -> bool: |
| 146 | """Send an status update for the webxdc instance of this message. |
| 147 | |
| 148 | If the webxdc instance is a draft, the update is not sent immediately. |
| 149 | Instead, the updates are collected and sent out in a batch when the instance is actually sent. |
| 150 | |
| 151 | :param json_data: program-readable data, the actual payload. |
| 152 | :param description: The user-visible description of JSON data |
| 153 | :returns: True on success, False otherwise |
| 154 | """ |
| 155 | if isinstance(json_data, dict): |
| 156 | json_data = json.dumps(json_data, default=str) |
| 157 | return bool( |
| 158 | lib.dc_send_webxdc_status_update( |
| 159 | self.account._dc_context, |
| 160 | self.id, |
| 161 | as_dc_charpointer(json_data), |
| 162 | as_dc_charpointer(description), |
| 163 | ), |
| 164 | ) |
| 165 | |
| 166 | def is_system_message(self): |
| 167 | """return True if this message is a system/info message.""" |