Posted to tcl by kostix at Sun Dec 24 20:34:53 GMT 2006view raw

  1. global usetabbar
  2.  
  3. if {$usetabbar} {
  4. foreach page [.nb pages] {
  5. lappend winids [ifacetk::nbpath $page]
  6. }
  7. }
  8.  
  9. set prio 0
  10. foreach chatid [array names opened] {
  11. set connid [get_connid $chatid]
  12. set jid [get_jid $chatid]
  13. set type $chats(type,$chatid)
  14.  
  15. if {$type == "groupchat"} {
  16. set nick [get_our_groupchat_nick $chatid]
  17. } else {
  18. set nick ""
  19. }
  20.  
  21. set user [jlib::connection_user $connid]
  22. set server [jlib::connection_server $connid]
  23. set resource [jlib::connection_resource $connid]
  24.  
  25. if {$usetabbar} {
  26. set prio [lsearch $winids [::chat::winid $chatid]]
  27. }
  28.  
  29. lappend session [list $prio $user $server $resource \
  30. [list [namespace current]::restore_window $jid $type $nick] \
  31. ]
  32.  
  33. incr prio
  34. }
  35.