save incoming state in db
This commit is contained in:
@@ -19,6 +19,7 @@ class LxmfMessage(BaseModel):
|
||||
destination_hash = CharField(index=True)
|
||||
state = CharField() # state is converted from internal int to a human friendly string
|
||||
progress = FloatField() # progress is converted from internal float 0.00-1.00 to float between 0.00/100 (2 decimal places)
|
||||
is_incoming = BooleanField() # if true, we should ignore state, it's set to draft by default on incoming messages
|
||||
content = TextField()
|
||||
fields = TextField() # json string
|
||||
created_at = DateTimeField(default=datetime.now)
|
||||
|
||||
4
web.py
4
web.py
@@ -192,6 +192,7 @@ class ReticulumWebChat:
|
||||
"hash": db_lxmf_message.hash,
|
||||
"source_hash": db_lxmf_message.source_hash,
|
||||
"destination_hash": db_lxmf_message.destination_hash,
|
||||
"is_incoming": db_lxmf_message.is_incoming,
|
||||
"state": db_lxmf_message.state,
|
||||
"progress": db_lxmf_message.progress,
|
||||
"content": db_lxmf_message.content,
|
||||
@@ -455,6 +456,7 @@ class ReticulumWebChat:
|
||||
"hash": lxmf_message.hash.hex(),
|
||||
"source_hash": lxmf_message.source_hash.hex(),
|
||||
"destination_hash": lxmf_message.destination_hash.hex(),
|
||||
"is_incoming": lxmf_message.incoming,
|
||||
"state": self.convert_lxmf_state_to_string(lxmf_message),
|
||||
"progress": progress_percentage,
|
||||
"content": lxmf_message.content.decode('utf-8'),
|
||||
@@ -494,6 +496,7 @@ class ReticulumWebChat:
|
||||
hash=lxmf_message_dict["hash"],
|
||||
source_hash=lxmf_message_dict["source_hash"],
|
||||
destination_hash=lxmf_message_dict["destination_hash"],
|
||||
is_incoming=lxmf_message_dict["is_incoming"],
|
||||
state=lxmf_message_dict["state"],
|
||||
progress=lxmf_message_dict["progress"],
|
||||
content=lxmf_message_dict["content"],
|
||||
@@ -539,6 +542,7 @@ class ReticulumWebChat:
|
||||
"hash": lxmf_message_dict["hash"],
|
||||
"source_hash": lxmf_message_dict["source_hash"],
|
||||
"destination_hash": lxmf_message_dict["destination_hash"],
|
||||
"is_incoming": lxmf_message_dict["is_incoming"],
|
||||
"state": lxmf_message_dict["state"],
|
||||
"progress": lxmf_message_dict["progress"],
|
||||
"content": lxmf_message_dict["content"],
|
||||
|
||||
Reference in New Issue
Block a user