Are you asking about finding all the common channels every member of a certain channel share with each other? For example, UserA, UserB, UserC, UserD, UserE and UserF are all in #ChanA and no one else is in there, but all of them are also in #ChanF, #ChanS and #ChanY. Are you trying to return #ChanF,#ChanS,#ChanY by specifying #ChanA?
Or are you trying to compile a list of every visible (channels that are -ps) channel that you can see from the whois of everyone on the channel?
UserA on #ChanA #ChanB #ChanF
UserB on #ChanA #ChanC #ChanF
UserC on #ChanA #ChanD #ChanG
UserD on #ChanA #ChanB #ChanG
UserE on #ChanA #ChanB #ChanC
UserF on #ChanA #ChanC #ChanE
Result: #ChanB #ChanC #ChanD #ChanE #ChanF #ChanG (when triggered from #ChanA)