84d
@verb #8585:"check_friends" this none this rxdo #9988
@program #8585:"check_friends" this none this
!caller_perms():controls(this) && raise(E_PERM)
for login in (this.current_login)
{who, fl, uname, pword, @stuff} = login
if (!valid(who))
this.current_login = setremove(this.current_login, login)
else
if (j = listiassoc(who, this.friends_notify))
notify = this.friends_notify[j]
{who, lastupdate} = notify
if (!valid(who))
this.friends_notify = setremove(this.friends_notify, notify)
elseif (who:connected(0))
{fl, uname, pword, @stuff} = this:get_login(who)
try
result = this:send_request({{"mode", "checkfriends"}, {"user", uname}, {"hpassword", pword}, {"lastupdate", lastupdate}})
except e (ANY)
"Some kind of error... ignore it?"
if (e[1] == E_INVARG)
"connection error. abort and retry later."
return
else
"It's a livejournal error. Better remove this user just to be safe."
this.friends_notify = setremove(this.friends_notify, notify)
continue
endif
endtry
if (lu = listassoc("lastupdate", result))
this.friends_notify[j][2] = lu[2]
endif
if (`toint(listassoc("new", result)[2]) ! ANY')
" `who:lj_friends_updated() ! E_VERBNF => who:tell({\"($djmoo) - Your friends page has been updated!\", \"Type 'lj-check' when you're ready to start watching your friends page again.\"})';"
`who:lj_friends_updated() ! E_VERBNF => who:tell({"($djmoo) - Your friends page has been updated!"})'
endif
suspend(max(`60 / length(this.friends_notify) ! E_DIV => 0', 1))
endif
endif
if (!who:connected())
i = listiassoc(who, this.current_login)
this.current_login[i][2] = 0
if (j)
this.friends_notify[j][2] = ""
endif
endif
endif
endfor
"Last modified by Dax (#789) on Tue May 3 14:14:41 2005 MDT."
.
0