LJ::delete_comments — deletes comments, but not the relational information, so threading doesn't break
LJ::delete_comments
(u, nodetype, nodeid, talkids+);
u. A hashref of a row from the user table, sometimes called a "user object". Although only initially a row from the user table, gets a lot of tacked onto it from various other LJ API functions.
nodetype. The thread nodetype (probably 'L' for log items)
nodeid. The thread nodeid for the given nodetype (probably the jitemid from the log2 row)
talkids+.
The tables talkprop2 and talktext2 are deleted from. talk2 just has its state column modified to 'D'.
cgi-bin/ljlib.pl
scalar integer; number of items deleted.