Update messaging history on disk.

        :returns: None
965039
def update_history(self) -> None:
        
        self.log.debug(f"Saving history. History is: \n{self.history}")

        jsons = []
        for item in self.history:
            json_item = item.__dict__

            # Convert sub-entries into JSON as well.
            json_item["output_records"] = self._parse_output_records(item)

            jsons.append(json_item)

        if not path.isfile(self.history_filename):
            open(self.history_filename, "a+").close()

        with open(self.history_filename, "w") as f:
            json.dump(jsons, f, default=lambda x: x.__dict__.copy(), sort_keys=True, indent=4)
            f.write("\n")
848852
def add_messages(self, messages):
        
        # remove old messages
        if len(messages) > self.limit:
            messages = messages[:self.limit]
        _logger(self.__class__).log(5, 'adding %s messages' % len(messages))
        self._finished = False
        self._new_messages = messages
        self._to_check = list(self._messages)
        self._pending_msg = messages
        # start removing messages, new message won't be added until we
        # checked all message that need to be removed
        QtCore.QTimer.singleShot(1, self._remove_batch)
1134007
private void updateMessage(ClientSocket client, DataInputStream buffer, byte messageSystemId, byte from)
            throws IOException
    {
        switch (messageSystemId)
        {
            case NetworkMessageSystemId.CONNECTING:
                receiveConnecting(client, buffer, from, StateConnection.CONNECTING);
                break;
            case NetworkMessageSystemId.CONNECTED:
                receiveConnected(client, from, StateConnection.CONNECTED);
                break;
            case NetworkMessageSystemId.PING:
                client.getOut().writeByte(NetworkMessageSystemId.PING);
                client.getOut().flush();
                bandwidth += 1;
                break;
            case NetworkMessageSystemId.OTHER_CLIENT_DISCONNECTED:
                receiveDisconnected(client, from, StateConnection.CONNECTED);
                break;
            case NetworkMessageSystemId.OTHER_CLIENT_RENAMED:
                receiveRenamed(client, buffer, from, StateConnection.CONNECTED);
                break;
            case NetworkMessageSystemId.USER_MESSAGE:
                receiveMessage(client, buffer, from, StateConnection.CONNECTED);
                break;
            default:
                break;
        }
    }
462716
def update(self):
        
        # with self._update_lock:
        self._update_lock.acquire()
        self._store_expansion_state()
        self.history_tree_store.clear()
        selected_sm_m = self.model.get_selected_state_machine_model()
        if not selected_sm_m:
            return

        for execution_number, execution_history in enumerate(selected_sm_m.state_machine.execution_histories):
            if len(execution_history) > 0:
                first_history_item = execution_history[0]
                # the next lines filter out the StateMachineStartItem, which is not intended to
                # be displayed, but merely as convenient entry point in the saved log file
                if isinstance(first_history_item, StateMachineStartItem):
                    if len(execution_history) > 1:
                        first_history_item = execution_history[1]
                        tree_item = self.history_tree_store.insert_after(
                            None,
                            None,
                            (first_history_item.state_reference.name + " - Run " + str(execution_number + 1),
                             first_history_item, self.TOOL_TIP_TEXT))
                        self.insert_execution_history(tree_item, execution_history[1:], is_root=True)
                    else:
                        pass  # there was only the Start item in the history
                else:
                    tree_item = self.history_tree_store.insert_after(
                        None,
                        None,
                        (first_history_item.state_reference.name + " - Run " + str(execution_number + 1),
                         first_history_item, self.TOOL_TIP_TEXT))
                    self.insert_execution_history(tree_item, execution_history, is_root=True)

        self._restore_expansion_state()
        self._update_lock.release()
664042
async def _reload_message(self):
        
        try:
            chat = await self.get_input_chat() if self.is_channel else None
            msg = await self._client.get_messages(chat, ids=self.id)
        except ValueError:
            return  # We may not have the input chat/get message failed
        if not msg:
            return  # The message may be deleted and it will be None

        self._sender = msg._sender
        self._input_sender = msg._input_sender
        self._chat = msg._chat
        self._input_chat = msg._input_chat
        self._via_bot = msg._via_bot
        self._via_input_bot = msg._via_input_bot
        self._forward = msg._forward
        self._action_entities = msg._action_entities
447969
def time_since(self, mtype):
        ''''''
        if not mtype in self.messages:
            return time.time() - self.start_time
        return time.time() - self.messages[mtype]._timestamp
761574
def update(self, data):
        """"""
        if data is None:
            for device in self.devices:
                device.clear_info()
        else:
            for device, device_info in zip(self.devices, data):
                device.device_info = device_info
                self.connection.log("Device information updated -> [{}]".format(device))
485189
def update_metadata(self, key: str, msg: MaildirMessage) -> None:
        
        subpath = self._lookup(key)
        subdir, name = os.path.split(subpath)
        new_subdir = msg.get_subdir()
        new_name = key + self.colon + msg.get_info()
        if subdir != new_subdir:
            raise ValueError('Message subdir may not be updated')
        elif name != new_name:
            new_subpath = os.path.join(msg.get_subdir(), new_name)
            old_path = os.path.join(self._path, subpath)
            new_path = os.path.join(self._path, new_subpath)
            os.rename(old_path, new_path)
            self._toc[key] = new_subpath
604741
def record_message(self, msg, from_rewarder):
        """"""
        if self.file:
            # Include an authoritative timestamp (because the `sent_at` from the server is likely to be different
            timestamped_message = {
                'timestamp': time.time(),
                'message': json.loads(msg),
                'from_rewarder': from_rewarder,
            }
            self.file.write(json.dumps(timestamped_message))
            self.file.write('\n')
            self.file.flush()
1145513
public void updateMessageDetail(MessageProcessInfo recMessageProcessInfo, Map<String,Object> map)
    {
        MessageDetail recMessageDetail = (MessageDetail)this.getRecord(MessageDetail.MESSAGE_DETAIL_FILE);
        MessageTransport recMessageTransport = (MessageTransport)this.getRecord(MessageTransport.MESSAGE_TRANSPORT_FILE);
        
        try {
            recMessageDetail.addNew();
            
            recMessageDetail.getField(MessageDetail.MESSAGE_PROCESS_INFO_ID).moveFieldToThis((BaseField)recMessageProcessInfo.getCounterField());
            recMessageDetail.getField(MessageDetail.MESSAGE_TRANSPORT_ID).moveFieldToThis((BaseField)recMessageTransport.getCounterField());
            if (recMessageDetail.seek(null))
                recMessageDetail.edit();
            else
                recMessageDetail.addNew();
            
            recMessageDetail.getField(MessageDetail.MESSAGE_PROCESS_INFO_ID).moveFieldToThis((BaseField)recMessageProcessInfo.getCounterField());
            recMessageDetail.getField(MessageDetail.MESSAGE_TRANSPORT_ID).moveFieldToThis((BaseField)recMessageTransport.getCounterField());
            String site = (map == null) ? null : (String)map.get(TrxMessageHeader.DESTINATION_PARAM);
            ((PropertiesField)recMessageDetail.getField(MessageDetail.PROPERTIES)).setProperty(TrxMessageHeader.DESTINATION_PARAM, site);
            String wspath = (map == null) ? null : (String)map.get(TrxMessageHeader.DESTINATION_MESSAGE_PARAM);
            ((PropertiesField)recMessageDetail.getField(MessageDetail.PROPERTIES)).setProperty(TrxMessageHeader.DESTINATION_MESSAGE_PARAM, wspath);
            
            if (recMessageDetail.getEditMode() == DBConstants.EDIT_ADD)
                recMessageDetail.add();
            else
                recMessageDetail.set();
        } catch (DBException e) {
            e.printStackTrace();
        }
    }
293262
def messaging(self):
        
        if self._messaging is None:
            self._messaging = MessagingList(self)
        return self._messaging
1075378
def im_history(self, room_id, **kwargs):
        """"""
        return self.__call_api_get('im.history', roomId=room_id, kwargs=kwargs)
12226
def update_history(self, directory):
        """"""
        try:
            directory = osp.abspath(to_text_string(directory))
            if directory in self.history:
                self.histindex = self.history.index(directory)
        except Exception:
            user_directory = get_home_dir()
            self.chdir(directory=user_directory, browsing_history=True)
776431
protected void updateMessage() {

        if (!hasIndividualMessage()) {
            m_message = Messages.get().container(Messages.ERR_MULTI_EXCEPTION_1, new Integer(m_exceptions.size()));
        }
    }
542666
def update_contents(self, stream, seek=0, size=None, chunk_size=None,
                        progress_callback=None, **kwargs):
        
        self.checksum = None
        return self.storage(**kwargs).update(
            stream, seek=seek, size=size, chunk_size=chunk_size,
            progress_callback=progress_callback
        )
1119342
def maybeUpdate(self):
        
        if self.wasModified():
            self.lastModified = self.filePath.getmtime()
            self.fileContents = self.filePath.getContent()
            self.hashValue = hashlib.sha1(self.fileContents).hexdigest()
627827
async def update_flags(self, messages: Sequence[MessageT],
                           flag_set: FrozenSet[Flag], mode: FlagOp) -> None:
        
        ...