1091 |
const struct ClassItem *const class = class_get_ptr(&target_p->connection->confs); |
const struct ClassItem *const class = class_get_ptr(&target_p->connection->confs); |
1092 |
|
|
1093 |
if (!(class->flags & CLASS_FLAGS_FAKE_IDLE) || target_p == source_p) |
if (!(class->flags & CLASS_FLAGS_FAKE_IDLE) || target_p == source_p) |
1094 |
return CurrentTime - target_p->connection->last_privmsg; |
return event_base->time.sec_monotonic - target_p->connection->last_privmsg; |
1095 |
|
|
1096 |
if (HasUMode(source_p, UMODE_OPER) && |
if (HasUMode(source_p, UMODE_OPER) && |
1097 |
!(class->flags & CLASS_FLAGS_HIDE_IDLE_FROM_OPERS)) |
!(class->flags & CLASS_FLAGS_HIDE_IDLE_FROM_OPERS)) |
1098 |
return CurrentTime - target_p->connection->last_privmsg; |
return event_base->time.sec_monotonic - target_p->connection->last_privmsg; |
1099 |
|
|
1100 |
const unsigned int min_idle = class->min_idle; |
const unsigned int min_idle = class->min_idle; |
1101 |
const unsigned int max_idle = class->max_idle; |
const unsigned int max_idle = class->max_idle; |
1106 |
if (class->flags & CLASS_FLAGS_RANDOM_IDLE) |
if (class->flags & CLASS_FLAGS_RANDOM_IDLE) |
1107 |
idle = genrand_int32(); |
idle = genrand_int32(); |
1108 |
else |
else |
1109 |
idle = CurrentTime - target_p->connection->last_privmsg; |
idle = event_base->time.sec_monotonic - target_p->connection->last_privmsg; |
1110 |
|
|
1111 |
if (max_idle) |
if (max_idle) |
1112 |
idle %= max_idle; |
idle %= max_idle; |