Another small patch. This one implements the new user list behavior
(list only users with logs) in the webcam session viewer. Also fixes a
typo in a comment.

        --Gabriel


________________________________________________________________________
Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel's Stuff - http://www.mysterystudio.com/gabriel
Index: loging.tcl
===================================================================
--- loging.tcl	(revisiĆ³n: 8243)
+++ loging.tcl	(copia de trabajo)
@@ -413,13 +413,17 @@
 
 		global log_dir langenc logvar
 
-		#Get all the contacts
-		foreach contact [::abook::getAllContacts] {
-			#Selects the contacts who are in our list and adds them to the contact_list
-			if {[string last "FL" [::abook::getContactData $contact lists]] != -1} {
-				lappend contact_list $contact
+		# Get all the contacts with logs
+		set lDirs [concat ${log_dir} [glob -nocomplain -types d "${log_dir}/*"]]
+
+		foreach sDir $lDirs {
+			foreach sLogFile [glob -tails -nocomplain -types f -directory ${sDir} "*.log"] {
+				set sLogFile [ string range $sLogFile 0 [ expr { [string length $sLogFile] - 5 } ] ]
+				set hNames($sLogFile) 1
 			}
 		}
+		
+		set contact_list [ array names hNames ]
 
 		#Sorts contacts
 		set sortedcontact_list [lsort -dictionary $contact_list]
@@ -427,7 +431,7 @@
 		#Add the eventlog
 		lappend sortedcontact_list eventlog
 
-		#If there is no email defined, we remplace it by the first email in the dictionary order
+		#If there is no email defined, we replace it by the first email in the dictionary order
 		if {$email == ""} {
 			set email [lindex $sortedcontact_list 0]
 		}
@@ -549,17 +553,17 @@
 
 		global webcam_dir langenc logvar
 
-		#Get all the contacts
-		foreach contact [::abook::getAllContacts] {
-			#Selects the contacts who are in our list and adds them to the contact_list
-			if {[string last "FL" [::abook::getContactData $contact lists]] != -1} {
-				lappend contact_list $contact
-			}
+		# Get all the contacts with saved webcam sessions
+		foreach sLogFile [glob -tails -nocomplain -types f -directory ${webcam_dir} "*.cam"] {
+			set sLogFile [ string range $sLogFile 0 [ expr { [string length $sLogFile] - 5 } ] ]
+			set hNames($sLogFile) 1
 		}
-		#Sorts contacts
+		
+		set contact_list [ array names hNames ]
+		
 		set sortedcontact_list [lsort -dictionary $contact_list]
 
-		#If there is no email defined, we remplace it by the first email in the dictionary order
+		#If there is no email defined, we replace it by the first email in the dictionary order
 		if {$email == ""} {
 			set email [lindex $sortedcontact_list 0]
 		}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to