All pastes #176540 Raw Edit

Untitled

public text v1 · immutable
#176540 ·published 2006-09-19 19:10 UTC
rendered paste body
	::abook::setContactData $chatid clientid $clientid

	##Find out how the client-program is called
	switch [expr {$clientid & 0xFF000000}] {
		268435456 {
			# 0x10000000
			set clientname "MSN 6.0"
		}
		536870912 {
			# 0x20000000
			set clientname "MSN 6.1"
		}
		805306368 {
			# 0x30000000
			set clientname "MSN 6.2"
		}
		1073741824 {
			# 0x40000000
			set clientname "MSN 7.0"
		}
		1342177280 {
			# 0x50000000
			set clientname "MSN 7.5"
		}
		1610612736 {
			# 0x60000000
			set clientname "Windows Live Messenger 8.0"
		}
		default {
			if {($clientid & 0x200) == [expr {0x200}]} {
				set clientname "Webmessenger"
			} elseif {($clientid & 0x800) == [expr {0x800}]} {
				set clientname "Microsoft Office gateway"
			} else {
				set clientname "[trans unknown]"
			}
		}
		
	}

	##Store the name of the client this user uses in the adressbook
	::abook::setContactData $chatid client $clientname