[Nym3-commit] r438 - in trunk/nymbaron: Client Server

jr at conuropsis.org jr at conuropsis.org
Sat Dec 10 00:58:02 CET 2005


Author: jr
Date: 2005-12-10 00:58:01 +0100 (Sat, 10 Dec 2005)
New Revision: 438

Modified:
   trunk/nymbaron/Client/Main.py
   trunk/nymbaron/Server/User.py
Log:
- remove useless test in encOldSyn [server]
- sort the syn by xnymseq order before displaying them [client]


Modified: trunk/nymbaron/Client/Main.py
===================================================================
--- trunk/nymbaron/Client/Main.py	2005-12-09 23:33:22 UTC (rev 437)
+++ trunk/nymbaron/Client/Main.py	2005-12-09 23:58:01 UTC (rev 438)
@@ -601,14 +601,22 @@
 	ui.display("empty synbox")
 	return
     mbox = account.get_mbox()[0]
-    for xnymseq, (mid, flag, syn) in synbox.iteritems():
+    # TODO here we need to go from str to int to str because the type of object
+    # we chose as key in the dictionnary synbox is str, but we need int order
+    # moving from int would break existing accounts. Should we add temporarily a
+    # migration function, or is breaking some accounts ok?
+    # for the time being, keep the same structure and convert data as we need
+    xnymseqs = map(int, synbox.keys())
+    xnymseqs.sort()
+    for xnymseq in xnymseqs:
+	(mid, flag, syn) = synbox[str(xnymseq)]
 	if mbox.has_key(mid):
 	    avail = "email available"
 	elif flag:
 	    avail = "email available on server"
 	else:
 	    avail = "email not available"
-	ui.display("%s %s %s" % (xnymseq, binascii.hexlify(mid), avail))
+	ui.display("%d %s %s" % (xnymseq, binascii.hexlify(mid), avail))
 	if summarize:
 	    ui.display(Mail.syn_summary(syn))
 	else:

Modified: trunk/nymbaron/Server/User.py
===================================================================
--- trunk/nymbaron/Server/User.py	2005-12-09 23:33:22 UTC (rev 437)
+++ trunk/nymbaron/Server/User.py	2005-12-09 23:58:01 UTC (rev 438)
@@ -634,8 +634,6 @@
 	    propyoung = lambda x: self.index[x[0][0]]['time'] +
 		self['EncryptSummaryAfter'] * 30 * 60) > now
 	    fyoung = binsearch(self.syn[offset:], propyoung)
-	    if fyoung == offset:
-		return
 	except:
 	    fyoung = last
 	self.encryptSyn(offset, fyoung)



More information about the Nym3-commit mailing list