- 9D70F920B8F62BCBC311319DFE98461EBD73E787CC1B97005B2F807F76F4FE99FB45A6650A04A149A854C8C547E87C77D00AFC39426A6756BCD5D7E5D8881221
+ B74685019898622685BD7F422BF5D7157AF5624EEDA40C5B976A3530E1E189B26E7CC38E5FCCD49C9A78ACD268C0154DD87F1014A6708AFBC0C184DE61D7E053
blatta/lib/message.py
(54 . 11)(54 . 13)
83 self.state = state
84 self.prefix = None
85 self.fork_status = None
86 # target peer handle
87 self.handle = message.get("handle")
88 self.peer = message.get("peer")
89 self.body = message.get("body")
90 self.timestamp = message.get("timestamp")
91 self.command = message.get("command")
92 # source peer handle
93 self.speaker = message.get("speaker")
94 self.bounces = message.get("bounces")
95 self.self_chain = message.get("self_chain")
(164 . 7)(166 . 6)
97
98 return cls._evaluate_message(long_buffer, order_buffer, message)
99
100
101 @classmethod
102 def _evaluate_message(cls, long_buffer, order_buffer, message):
103 # if we're expecting this message as a GETDATA response, skip the timestamp check
(231 . 16)(232 . 10)
105
106 @classmethod
107 def _evaluate_direct(cls, long_buffer, order_buffer, message):
108 # if this is the first direct message from a station, we needn't check for antecedents
109 if message['self_chain'] == EMPTY_CHAIN:
110 return message
111
112 # no need to check net_chain for a direct message
113 if not (long_buffer.has(message['self_chain'])):
114 if not order_buffer.has(message['message_hash']):
115 order_buffer.add(message)
116 message['error_code'] = OUT_OF_ORDER_SELF
117 return message
118 message['error_code'] = OUT_OF_ORDER_SELF
119 return message
120 return message
121
122 @classmethod
(267 . 15)(262 . 6)
124 return int_ts, self_chain, net_chain, speaker, body
125
126 @classmethod
127 def _unpack_last_valid_message(cls, last_message_info):
128 if last_message_info.get('message_bytes'):
129 return cls._unpack_message(
130 last_message_info['message_bytes']
131 )[4]
132 else:
133 return "<no prior message received>"
134
135 @classmethod
136 def _pad(cls, text, size):
137 return text.ljust(size, "\x00")
138