putlog "User has: $hasflag"
putlog "Request for adding: $newflags"

foreach curhasflag [split $hasflag ":"] {
    putlog "Checking for $curhasflag"
    set $newflags [string map {$curhasflag ""} $newflags]
}								
putlog "Adding: $newflags"


# Gives the folowing output:

[20:23] User has: A:B:C
[20:23] Request for adding: ABC
[20:23] Checking for A
[20:23] Checking for B
[20:23] Checking for C
[20:23] Adding: ABC