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

jr at conuropsis.org jr at conuropsis.org
Fri Apr 29 15:04:11 CEST 2005


Author: jr
Date: 2005-04-29 15:04:06 +0200 (Fri, 29 Apr 2005)
New Revision: 208

Modified:
   trunk/nym3/Client/Account.py
   trunk/nym3/Client/Main.py
Log:
Status control message message processing


Modified: trunk/nym3/Client/Account.py
===================================================================
--- trunk/nym3/Client/Account.py	2005-04-29 10:33:13 UTC (rev 207)
+++ trunk/nym3/Client/Account.py	2005-04-29 13:04:06 UTC (rev 208)
@@ -283,6 +283,14 @@
 	self.journal[seqno] = (msg, int(time.time()))
 	self.journal_status = 'dirty'
 
+    def acknowledge(self, seqno_list):
+	if seqno_list == None or seqno_list == []: return
+	if self.journal_status == 'unloaded': self._load_journal()
+	for el in seqno_list:
+	    if self.journal.has_key(el):
+		del self.journal[el]
+		self.journal_status = 'dirty'
+
     def get_seqno(self):
 	"""Return a previously unused sequence number"""
 	ret = chr(0) * SEQNO_LEN

Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2005-04-29 10:33:13 UTC (rev 207)
+++ trunk/nym3/Client/Main.py	2005-04-29 13:04:06 UTC (rev 208)
@@ -100,7 +100,15 @@
 	    ui.display("Account " + nickname + " successfully registered"
 		       " with username " + com.nym)
 	elif (com.ct() == SToCCODE['Status']):
-	    pass
+	    #update the fields
+	    account['nMsg'] = com.nMsg
+	    account['nSurb'] = com.nSurb
+	    account['quota'] = com.quota
+	    account['used'] = com.used
+	    #remove from the journal the acknowledged messages
+	    account.acknowledge(com.acks)
+	    #raise some warnings
+	    #exec some automatic actions and warn the user
 	elif (com.ct() == SToCCODE['Summary']):
 	    pass
 	elif (com.ct() == SToCCODE['Msg']):



More information about the Nym3-commit mailing list