File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 142
142
while (!System_Daemon::isDying ()) {
143
143
$ posts = getTimeline ();
144
144
$ lastCachedId = $ lastNoticeId ;
145
+ $ currentReadIndex = array ();
145
146
foreach ($ posts as $ post ) {
146
147
// Store the ID so we don't reparse notices we've already seen
147
148
if ($ post ->id > $ lastNoticeId )
168
169
$ newUser = true ;
169
170
}
170
171
172
+ // Count how many notices from this user we've seen this loop
173
+ if (!isset ($ currentReadIndex [$ post ->user ->id ]))
174
+ $ currentReadIndex [$ post ->user ->id ] = 0 ;
175
+ $ currentReadIndex [$ post ->user ->id ]++;
176
+
171
177
// Send a welcome if they have only one notice
172
- if ($ post ->user ->statuses_count == 1 && $ newUser ) {
178
+ if ($ post ->user ->statuses_count == $ currentReadIndex [ $ post -> user -> id ] && $ newUser ) {
173
179
System_Daemon::info ('new user found: %s ' , $ post ->user ->screen_name );
174
180
postNotice (getMessage ($ post ->user ->screen_name ), $ post ->id );
175
181
continue ;
You can’t perform that action at this time.
0 commit comments