Skip to content

Commit d8f1c78

Browse files
committed
print directory node info
1 parent 88b5e6a commit d8f1c78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jmdaemon/jmdaemon/onionmc.py

+4
Original file line numberDiff line numberDiff line change
@@ -1169,11 +1169,13 @@ def process_handshake(self, peerid: str, message: str,
11691169
accepted = handshake_json["accepted"]
11701170
nick = handshake_json["nick"]
11711171
net = handshake_json["network"]
1172+
motd = handshake_json["motd"]
11721173
assert isinstance(proto_max, int)
11731174
assert isinstance(proto_min, int)
11741175
assert isinstance(features, dict)
11751176
assert isinstance(nick, str)
11761177
assert isinstance(net, str)
1178+
assert isinstance(motd, str)
11771179
except Exception as e:
11781180
log.warn("Invalid handshake message from: {},"
11791181
" exception: {}, message: {},ignoring".format(
@@ -1200,6 +1202,8 @@ def process_handshake(self, peerid: str, message: str,
12001202
return
12011203
# We received a valid, accepting dn-handshake. Update the peer.
12021204
peer.update_status(PEER_STATUS_HANDSHAKED)
1205+
# Show the info for the directory to the user, with emphasis:
1206+
self.info_callback("\n\n" + motd + "\n\n")
12031207
peer.set_nick(nick)
12041208
else:
12051209
# it means, we are receiving an initial handshake

0 commit comments

Comments
 (0)