2005-12-04 jrandom

* Bugfix in Syndie for a problem in the threaded indexer (thanks CofE!)
    * Always include ourselves in the favorite authors (since we don't
      bookmark ourselves)
This commit is contained in:
jrandom
2005-12-04 20:02:24 +00:00
committed by zzz
parent 5faca98176
commit fbd7feee61
4 changed files with 30 additions and 4 deletions

View File

@ -84,6 +84,7 @@ class ArchiveIndexer {
totalSize += entry.getCompleteSize();
String entryTags[] = entry.getTags();
threads.addEntry(entry.getURI(), entryTags);
log.debug("Adding entry " + entry.getURI() + " to the threads, with tag count " + (entryTags != null ? entryTags.length : 0));
for (int t = 0; t < entryTags.length; t++) {
if (!tags.containsKey(entryTags[t])) {
tags.put(entryTags[t], new TreeMap());
@ -106,6 +107,7 @@ class ArchiveIndexer {
String forceNewThread = rec.getHeader(HTMLRenderer.HEADER_FORCE_NEW_THREAD);
if ( (forceNewThread != null) && (Boolean.valueOf(forceNewThread).booleanValue()) ) {
// ignore the parent
log.warn("Ignore the parent of " + entry.getURI() + ": " + reply);
} else {
BlogURI parent = new BlogURI(reply.trim());
if ( (parent.getKeyHash() != null) && (parent.getEntryId() >= 0) ) {

View File

@ -29,7 +29,12 @@ class WritableThreadIndex extends ThreadIndex {
void addParent(BlogURI parent, BlogURI child) { _parents.put(child, parent); }
void addEntry(BlogURI entry, String tags[]) {
if (tags == null) tags = NO_TAGS;
String oldTags[] = (String[])_tags.put(entry, tags);
Object old = _tags.get(entry);
if (old != null) {
System.err.println("Old value: " + old + " new tags: " + tags + " entry: " + entry);
} else {
_tags.put(entry, tags);
}
}
/**
@ -108,7 +113,9 @@ class WritableThreadIndex extends ThreadIndex {
while (node.getParent() != null)
node = node.getParent();
roots.add(node);
if (!roots.contains(node)) {
roots.add(node);
}
}
// store them, sorted by most recently updated thread first
@ -154,7 +161,16 @@ class WritableThreadIndex extends ThreadIndex {
if (l > r) {
return -1;
} else if (l == r) {
return DataHelper.compareTo(left.getEntry().getKeyHash().getData(), right.getEntry().getKeyHash().getData());
// ok, the newest responses match, so lets fall back and compare the roots themselves
l = left.getEntry().getEntryId();
r = right.getEntry().getEntryId();
if (l > r) {
return -1;
} else if (l == r) {
return DataHelper.compareTo(left.getEntry().getKeyHash().getData(), right.getEntry().getKeyHash().getData());
} else {
return 1;
}
} else {
return 1;
}

View File

@ -79,6 +79,9 @@ public class ViewThreadedServlet extends BaseServlet {
}
}
}
// always include ourselves...
aindex.selectMatchesOrderByEntryId(rv, user.getBlog(), tags, dayBegin);
Collections.sort(rv, BlogURI.COMPARATOR);
} else {
Hash loc = new Hash();

View File

@ -1,4 +1,9 @@
$Id: history.txt,v 1.344 2005/12/03 14:03:46 jrandom Exp $
$Id: history.txt,v 1.345 2005/12/03 22:18:09 jrandom Exp $
2005-12-04 jrandom
* Bugfix in Syndie for a problem in the threaded indexer (thanks CofE!)
* Always include ourselves in the favorite authors (since we don't
bookmark ourselves)
2005-12-03 jrandom
* Use newgroup-like tags by default in Syndie's interface