From 71beaa67baa6165f1fbd281f1a92412d2d92b8a7 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 1 Oct 2013 01:52:55 +0000
Subject: [PATCH] Update for the new get_all_msg_headers() return value.

---
 exec/load/msgutils.js | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/exec/load/msgutils.js b/exec/load/msgutils.js
index 0d8e8ff63f..adc350cc39 100644
--- a/exec/load/msgutils.js
+++ b/exec/load/msgutils.js
@@ -369,7 +369,6 @@ function getMessageThreads(sub, max) {
 	var subject;
 	var msgBase = new MsgBase(sub);
 	var header_num={};
-	var all_headers=[];
 	var m;
 	var new_thread;
 
@@ -381,10 +380,12 @@ function getMessageThreads(sub, max) {
 	else
 		max = msgBase.last_msg - max;
 	if(msgBase.get_all_msg_headers !== undefined && max <= msgBase.first_msg)
-		all_headers=msgBase.get_all_msg_headers();
+		header_num=msgBase.get_all_msg_headers();
 	else {
-		for(m=max; m <= msgBase.last_msg; m++)
-			all_headers.push(msgBase.get_msg_header(m));
+		for(m=max; m <= msgBase.last_msg; m++) {
+			header=msgBase.get_msg_header(m);
+			header_num[header.num]=header;
+		}
 	}
 
 	function add_to_thread(header, thread)
@@ -394,8 +395,8 @@ function getMessageThreads(sub, max) {
 		thread.messages.push(header);
 	}
 
-	for(m in all_headers) {
-		header = all_headers[m];
+	for(m in header_num) {
+		header = header_num[m];
 		if(
 			header === null
 			||
-- 
GitLab