Is there a way to test what channel-modes a user has set on them? Like... I know halfop and admin (%/+h and !/+a) aren't global modes that are on all servers... but I want to be able to test for them, so I can update the who's in chat list to say who the halfops and admins are. And if you would, I read the documentation, but I didn't get how to check for ops and voices, either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
there is a Op and a Voice array in the channel object:
$irc->channel['#chan']->ops;
and
$irc->channel['#chan']->voices;
also in the CVS version of SmartIRC you can do:
$irc->isOpped($chan, $user);
$irc->isVoiced($chan, $user);
$irc->isJoined($chan, $user);
and
$irc->isBanned($chan, $hostmask);
kinda handy functions ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's a suggestion, how about an $irc->isMode($chan, $mode, $user) function? That could allow us to test for any mode, rather than just the standard Op, Voice, and Banned modes. So...
$irc->isMode('#test', '+a', 'Nick');
... would return true if Nick is an admin in #test. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way to test what channel-modes a user has set on them? Like... I know halfop and admin (%/+h and !/+a) aren't global modes that are on all servers... but I want to be able to test for them, so I can update the who's in chat list to say who the halfops and admins are. And if you would, I read the documentation, but I didn't get how to check for ops and voices, either.
there is a Op and a Voice array in the channel object:
$irc->channel['#chan']->ops;
and
$irc->channel['#chan']->voices;
also in the CVS version of SmartIRC you can do:
$irc->isOpped($chan, $user);
$irc->isVoiced($chan, $user);
$irc->isJoined($chan, $user);
and
$irc->isBanned($chan, $hostmask);
kinda handy functions ;)
Here's a suggestion, how about an $irc->isMode($chan, $mode, $user) function? That could allow us to test for any mode, rather than just the standard Op, Voice, and Banned modes. So...
$irc->isMode('#test', '+a', 'Nick');
... would return true if Nick is an admin in #test. :)