This took WAY too long to see. The logs shouldn't be sorted while we're
still in the outer loop. Sort at the end once we've collected all the logs
we can.
/*
* irssi - Implements several irssi features for Purple
* Copyright (C) 2005-2008 Gary Kramlich <grim@reaperworld.com>
* Copyright (C) 2006-2008 John Bailey <rekkanoryo@rekkanoryo.org>