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

jr at conuropsis.org jr at conuropsis.org
Sat Nov 26 21:53:47 CET 2005


Author: jr
Date: 2005-11-26 21:53:46 +0100 (Sat, 26 Nov 2005)
New Revision: 429

Modified:
   trunk/nymbaron/Client/Main.py
   trunk/nymbaron/Server/Main.py
   trunk/nymbaron/Server/User.py
Log:
- fix the empty message bug (due to no new synopsis) [server]
- make the client able to cope with empty summary [client]


Modified: trunk/nymbaron/Client/Main.py
===================================================================
--- trunk/nymbaron/Client/Main.py	2005-11-26 00:15:51 UTC (rev 428)
+++ trunk/nymbaron/Client/Main.py	2005-11-26 20:53:46 UTC (rev 429)
@@ -297,6 +297,10 @@
 	    ui.display("Maximum storage on the server: " + str(com.quota))
 	    ui.display("Currently used storage on the server: " + str(com.used))
 	elif (com.ct() == SToCCODE['Summary']):
+	    # Check the Summary for emptiness
+	    if not com.synSet:
+		ui.display("No new synopsis available")
+		return
 	    # We need to decrypt the set of synopsis to retrieve the MIDs
 	    secring = decode_secring(config, ui)
 	    clear = decipher_string(com.synSet, secring, account['encKeys'])

Modified: trunk/nymbaron/Server/Main.py
===================================================================
--- trunk/nymbaron/Server/Main.py	2005-11-26 00:15:51 UTC (rev 428)
+++ trunk/nymbaron/Server/Main.py	2005-11-26 20:53:46 UTC (rev 429)
@@ -250,12 +250,16 @@
 			comList = []
 			sendList = nymUser.prepareSummary(com.num, com.after)
 			mList = []
-			print str(sendList)
-			for (ml, bf, blob) in sendList:
+			if sendList:
+			    for (ml, bf, blob) in sendList:
+				sumCom = Message.Summary()
+				sumCom.fromData(bf, blob)
+				comList.append(sumCom)
+				mList = mList + ml
+			else:
 			    sumCom = Message.Summary()
-			    sumCom.fromData(bf, blob)
-			    comList.append(sumCom)
-			    mList = mList + ml
+			    sumCom.fromData("\x00\x00","")
+			    comList = [sumCom]
 			ec = nymUser.send(Message.buildMessage(comList))
 			if (ec == 0):
 			    nymUser.markMid(mList, lifeCycle['synopsis-sent'])

Modified: trunk/nymbaron/Server/User.py
===================================================================
--- trunk/nymbaron/Server/User.py	2005-11-26 00:15:51 UTC (rev 428)
+++ trunk/nymbaron/Server/User.py	2005-11-26 20:53:46 UTC (rev 429)
@@ -577,10 +577,11 @@
     def markMid(self,l,mark):
         """The status of the mids in l which had a status
         previous to mark in the lifeCycle are set to mark"""
-        self.load_index()
-        for e in l:
-            if (self.index[e]['status'] < mark):
-                self.index[e]['status'] = mark
+	if l:
+	    self.load_index()
+	    for e in l:
+		if (self.index[e]['status'] < mark):
+		    self.index[e]['status'] = mark
         
     def hasMail(self, mid):
 	"""Checks whether the server holds a mail for a given mid"""



More information about the Nym3-commit mailing list