I think mIRC must already get this information, since that's what is returned when using something like
/echo -a $nick(<channel>,<nick>).idle