Fixing my plugin's SQL for WordPress 2.3

I just upgraded WordPress to version 2.3 RC 1 at my test blog, and found out that changes in the taxonomy schema break my Parental Control plugin in a nasty way. Fortunately, it was quite easy to fix.

I added a test for WordPress’ version and branched the SQL accordingly:

if (version_compare(get_bloginfo('version'), '2.3-RC1', '<')) {
	$text .= " AND ( '".$jupc_excluded_cat."'  ALL (SELECT category_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.post_id = $wpdb->posts.ID) )";
}
else {
	$text .= " AND ( '".$jupc_excluded_cat."'  ALL (SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE $wpdb->term_relationships.object_id = $wpdb->posts.ID) )";
}

The code above reserved for versions 2.3 RC1 and above would probably work with the 2.3 Betas as well, but as I don’t have any interest in testing already obsolete versions, I decided to draw the line to 2.3 RC1, so the code above probably won’t work with 2.3 trunk versions below RC1.

My own Gtalk account appearing in Pidgin contacts (solved?)

I sometimes resort to sending important files as attachments to my own e-mail address. Doing so in Gmail a couple of nights back made my own Gmail/Gtalk account appear in my Pidgin contacts. This was a little annoying mostly because since then, whenever I would change my state, I would get a Buddy State Notification announcing my own, new status.

Simply removing the contact from Pidgin didn’t work at first, but blocking it it after that seemed to remove it. But changing my status or restarting Pidgin brought it back again. Then the actual removing started to work, but again the contact kept popping back with every status change or restart.

At first I didn’t pinpoint the problem back to Gmail and tried removing my Gmail address from my Hotmail account’s contacts (thinking that would be the logical culprit, as one of my IM accounts handled by Pidgin is on MSN), but that didn’t help either.

In the end I connected the dots in my mind and went to my Gmail contacts, deleting my own address there. But even that didn’t remove it from Pidgin’s list. Finally, after turning instant messaging on in Gmail (I usually keep it turned off since I have Pidgin for IM) and removing myself from its contacts, ‘I’ disappeared from Pidgin’s sight. Apparently the two pages used to handle Gmail’s and Gtalk’s contacts are different, although they look identical.