| 1104 | } |
| 1105 | |
| 1106 | void Attachment::setupIdleTimer(bool clear) |
| 1107 | { |
| 1108 | unsigned int timeout = clear ? 0 : getActualIdleTimeout(); |
| 1109 | if (!timeout || hasActiveRequests()) |
| 1110 | { |
| 1111 | if (att_idle_timer) |
| 1112 | att_idle_timer->reset(0); |
| 1113 | } |
| 1114 | else |
| 1115 | { |
| 1116 | if (!att_idle_timer) |
| 1117 | { |
| 1118 | using IdleTimer = TimerWithRef<StableAttachmentPart>; |
| 1119 | |
| 1120 | auto idleTimer = FB_NEW IdleTimer(getStable()); |
| 1121 | idleTimer->setOnTimer(&StableAttachmentPart::onIdleTimer); |
| 1122 | att_idle_timer = idleTimer; |
| 1123 | } |
| 1124 | |
| 1125 | att_idle_timer->reset(timeout); |
| 1126 | } |
| 1127 | } |
| 1128 | |
| 1129 | UserId* Attachment::getUserId(const MetaString& userName) |
| 1130 | { |
no test coverage detected