@verb #8585:"dj-post dj-update" any any any rxdo #9988 @program #8585:"dj-post dj-update" any any any if (caller_perms() != player) raise(E_PERM) endif subject = argstr if (login = this:get_login(player)) if (!(postevent = `listassoc(player, this.current_post)[2] ! E_RANGE => {}') || !$cmd_utils:yes_or_no("Your last journal entry failed to post. Would you like to attempt to post it again?")) if (postevent) postevent = {} endif try {fl, user, pword, pics, journals, moods} = login except (E_ARGS) return player:tell("Your user info is out of date, or $ljmoo is broken. Please try running lj-login again, and if that does not solve the problem, complain to ", $su:nn(this.owner), "!") endtry if ((currentuser = `listassoc(player, this.current_user)[2] ! ANY => user') != user && !$cmd_utils:yes_or_no(tostr("Do you REALLY want to post an entry in ", currentuser, "?"))) player:tell("Posting in your journal instead.") currentuser = user endif player:tell("Writing entry with subject '", subject || "(no subject)", "'.") event = $cmd_utils:read_lines() mood = `player.mood ! E_PROPNF' || $cmd_utils:read("your mood") if (mood in pics) pic = mood else player:tell("You can select one of the following pictures, or just hit enter to use the default:") player:tell($su:columnize(pics, 4)) while (!((pic = $cmd_utils:read("the picture name")) in {"", @pics})) endwhile endif player:tell("You have chosen to use your ", pic == "" ? "default" | tostr("\"", pic, "\""), " picture") player:tell("If you are listening to music, enter it now. If not, simply press Enter to skip this step.") music = $cmd_utils:read("the music you are listening to") player:tell({"To make this entry only readable to friends, type 'friends'. To make it protected, type 'protected'.", "Otherwise just hit Enter to make this entry public."}) while (!(security = $cmd_utils:read("the security level") in {"", "public", "friends", "protected"})) endwhile security = security - 2 postevent = {{"mode", "postevent"}, {"user", user}, {"hpassword", pword}, {"subject", subject}, {"event", event}} {year, mon, day, hour, min} = $string_utils:explode($time_utils:time_sub("$Y $2 $t $h $m", time(), player)) postevent = {@postevent, {"year", year}, {"mon", mon}, {"day", day}, {"hour", hour}, {"min", min}} if (pic) postevent = {@postevent, {"prop_picture_keyword", pic}} endif if (`id = listassoc(mood, moods, 2)[1] ! E_RANGE, E_TYPE') postevent = {@postevent, {"prop_current_moodid", id}} else postevent = {@postevent, {"prop_current_mood", mood}} endif if (music) postevent = {@postevent, {"prop_current_music", music}} endif if (security > 0) postevent = {@postevent, {"security", {"usemask", "protected"}[security]}} security == 1 && (postevent = {@postevent, {"allowmask", "1"}}) endif " currentuser = `listassoc(player, this.current_user)[2] ! ANY => user';" " if ((user != currentuser) && (!`$cmd_utils:yes_or_no(tostr(\"Are you SURE you want to post this entry in \", currentuser, \"?\")) ! ANY'))" " return player:tell(\"Update aborted!\");" if (user != currentuser) postevent = {@postevent, {"usejournal", currentuser}} endif if (i = listiassoc(player, this.current_post)) player:tell("Deleting failed journal post.") this.current_post = listdelete(this.current_post, i) endif else player:tell("Attempting to repost failed entry.") if (i = listiassoc(player, this.current_post)) this.current_post = listdelete(this.current_post, i) endif endif try this:send_request(postevent) except e (ANY) player:tell("Saving journal entry for reposting later... (type lj-update to repost)") if (!listassoc(player, this.current_post)) this.current_post = {@this.current_post, {player, postevent}} endif return player:tell({"Post failed:", e[2]}) endtry player:tell("Post uploaded successfully!") else player:tell("You can't post unless you're logged in.") endif "Last modified by Cecil (#7407) on Mon Feb 4 17:25:46 2002 MST." .