aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2018-08-11 09:44:18 +0200
committert3sserakt <t3ss@posteo.de>2018-08-11 09:48:23 +0200
commit88d96e84d9824fde3f0c9a765a3e28ef6ebc7b7e (patch)
tree93b304d9d6ffa1365b8e598db7da4013abba4ae2
parent866deb51c1b521c83dc6d581377ce29d5cd3b597 (diff)
downloadgnunet-nim-88d96e84d9824fde3f0c9a765a3e28ef6ebc7b7e.tar.gz
gnunet-nim-88d96e84d9824fde3f0c9a765a3e28ef6ebc7b7e.zip
added date and time string to output
-rw-r--r--examples/groupchat.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/groupchat.nim b/examples/groupchat.nim
index ffc7771..26f9848 100644
--- a/examples/groupchat.nim
+++ b/examples/groupchat.nim
@@ -1,5 +1,5 @@
1import ../gnunet_application, ../asynccadet, ../gnunet_utils 1import ../gnunet_application, ../asynccadet, ../gnunet_utils
2import asyncdispatch, asyncfile, parseopt, strutils, sequtils 2import asyncdispatch, asyncfile, parseopt, strutils, sequtils, times, os
3 3
4type Chat = object 4type Chat = object
5 channels: seq[ref CadetChannel] 5 channels: seq[ref CadetChannel]
@@ -8,7 +8,7 @@ proc publish(chat: ref Chat, message: string, sender: ref CadetChannel = nil) =
8 let message = 8 let message =
9 if sender.isNil(): message.strip(leading = false) 9 if sender.isNil(): message.strip(leading = false)
10 else: "[" & sender.peer.peerId() & "] " & message.strip(leading = false) 10 else: "[" & sender.peer.peerId() & "] " & message.strip(leading = false)
11 echo message 11 echo getDatestr(), " ", getClockStr(), " ", message
12 for c in chat.channels: 12 for c in chat.channels:
13 c.sendMessage(message) 13 c.sendMessage(message)
14 14
@@ -34,7 +34,7 @@ proc processServerMessages(channel: ref CadetChannel) {.async.} =
34 let (hasData, message) = messageFuture.read() 34 let (hasData, message) = messageFuture.read()
35 if not hasData: 35 if not hasData:
36 break 36 break
37 echo message 37 echo getDateStr()," ",getClockStr()," ",message
38 messageFuture = channel.messages.read() 38 messageFuture = channel.messages.read()
39 39
40proc firstTask(gnunetApp: ref GnunetApplication, 40proc firstTask(gnunetApp: ref GnunetApplication,