[Nym3-commit] r198 - trunk/nym3/Client

laurent at conuropsis.org laurent at conuropsis.org
Mon Apr 18 18:44:44 CEST 2005


Author: laurent
Date: 2005-04-18 18:44:40 +0200 (Mon, 18 Apr 2005)
New Revision: 198

Modified:
   trunk/nym3/Client/Account.py
   trunk/nym3/Client/Main.py
Log:
Added support for `Created' control message in the client.


Modified: trunk/nym3/Client/Account.py
===================================================================
--- trunk/nym3/Client/Account.py	2005-04-11 20:56:33 UTC (rev 197)
+++ trunk/nym3/Client/Account.py	2005-04-18 16:44:40 UTC (rev 198)
@@ -123,6 +123,9 @@
 	- idTag is the identity string used to generate SURBs for this
 	  account. It is therefore unique to this account. Additionnaly
 	  it is used to name the subdirectory holding this account's data
+	- 'handshake' tells how far we are in the account creation handshake,
+	  it is one of 'initiated', 'got_challenge', 'answered_challenge' or
+	  'completed'.
 	- misc parameters that needs further documentation.
 	- data is the hash that contains all of this
 	- datafile() is the file where we pickle from and to the data hash

Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2005-04-11 20:56:33 UTC (rev 197)
+++ trunk/nym3/Client/Main.py	2005-04-18 16:44:40 UTC (rev 198)
@@ -77,14 +77,17 @@
     def display(self, s):
 	print s
 
-def processMessage(msg):
+def processMessage(msg, config, ui, nickname):
     """process incoming control message"""
       
     sr = Message.StrReader(msg)
     comList = sr.readCommandCToSList()
     for com in comList:
-        if (com.ct() == SToCCODE['Created']):
-	    pass
+	if (com.ct() == SToCCODE['Created']):
+	    account = Account.Account(config, nickname)
+	    # No challenge/response scheme decided yet:
+	    account['handshake'] = 'completed'
+	    ui.display("Account " + nickname + " successfully registered.")
 	elif (com.ct() == SToCCODE['Status']):
             pass
         elif (com.ct() == SToCCODE['Summary']):
@@ -169,6 +172,7 @@
     surbc = Message.Surb()
     surbc.fromData(account.generateSurbs(7))
     account.sendControl([createc, newpkc, surbc], idKey)
+    account['handshake'] = "initiated"
 	
 def main(args):
     if len(args) < 2:



More information about the Nym3-commit mailing list