Ok, horrible bug in delete_pm()...
Say we want to delete a message, delete_pm() extracts
the correct row from ibf_message_topics and deletes it.
It also deletes the realting row from ibf_message_text.
This might sound correct but in fact it is very broken.
Consider that Abby sends Bob a message. She decides to
save a copy in her sent items folder. ipbsdk inserts
two rows into message_topics (lets give them ids 80 and
81). ipbsdk inserts a row into message_text (id 70) to
which the two message_topic rows refer.
Now, Abby decides to delete her copy of the sent item
BEFORE Bob reads his message. Because delete_pm()
didn't check if the message_text row was still in use
by any message_topic rows, it INCORRECTLY deletes the
message. Poor bob logs in and apparently has a new
message waiting for him, he clicks on it yet the
message is blank because the message_text has been
deleted. A similar scenario occurs when a If Bob was to
delete his message and then Abby wanted to read the
copy in her sent items.
Logged In: YES
user_id=1091024
Originator: NO
Eugh that's not nice...
Will take a gander.