$comchan(nick,N)
Returns the names of channels which both you and nick are on.
Properties: op, help, voice,
$comchan(nick,0) returns the total number of common channels
$comchan(nick,1) returns the first common channel name
$comchan(nick,1).op returns $true if you're an op on the channel
^From the help file.