Switch to edit mode.
Name(s): check_friends1: !caller_perms():controls(this) && raise(E_PERM)
2: for login in (this.current_login)
3: {who, fl, uname, pword, @stuff} = login
4: if (!valid(who))
5: this.current_login = setremove(this.current_login, login)
6: else
7: if (j = $list_utils:iassoc(who, this.friends_notify))
8: notify = this.friends_notify[j]
9: {who, lastupdate} = notify
10: if (!valid(who))
11: this.friends_notify = setremove(this.friends_notify, notify)
12: elseif (who:connected(0))
13: {fl, uname, pword, @stuff} = this:get_login(who)
14: try
15: result = this:send_request({{"mode", "checkfriends"}, {"user", uname}, {"hpassword", pword}, {"lastupdate", lastupdate}})
16: except e (ANY)
17: "Some kind of error... ignore it?"
18: if (e[1] == E_INVARG)
19: "connection error. abort and retry later."
20: return
21: else
22: "It's a livejournal error. Better remove this user just to be safe."
23: this.friends_notify = setremove(this.friends_notify, notify)
24: continue
25: endif
26: endtry
27: if (lu = listassoc(result, "lastupdate"))
28: this.friends_notify[j][2] = lu[2]
29: endif
30: if (`toint(listassoc(result, "new")[2]) ! ANY')
31: " `who:lj_friends_updated() ! E_VERBNF => who:tell({\"<b><font color=#00FF00>($ljmoo) - Your friends page has been updated!</font></b>\", \"Type 'lj-check' when you're ready to start watching your friends page again.\"})';"
32: `who:lj_friends_updated() ! E_VERBNF => who:tell({"<b><font color=#00FF00>($ljmoo) - Your friends page has been updated!</font></b>"})'
33: endif
34: suspend(max(`60 / length(this.friends_notify) ! E_DIV => 0', 1))
35: endif
36: endif
37: if (!who:connected())
38: i = $list_utils:iassoc(who, this.current_login)
39: this.current_login[i][2] = 0
40: if (j)
41: this.friends_notify[j][2] = ""
42: endif
43: endif
44: endif
45: endfor
46: "Last modified by Dax (#789) on Wed Jan 24 17:28:25 2007 EST."