Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
43e49f2f
Commit
43e49f2f
authored
12 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Index threads based on thread_id property that apparently exists.
parent
19f75898
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/msgutils.js
+15
-45
15 additions, 45 deletions
exec/load/msgutils.js
with
15 additions
and
45 deletions
exec/load/msgutils.js
+
15
−
45
View file @
43e49f2f
...
...
@@ -364,7 +364,6 @@ function getMessageThreads(sub, max) {
if
(
max
===
undefined
)
max
=
0
;
var
threads
=
{
thread
:
{},
dates
:
[],
order
:
[]
};
var
threadedMessages
=
[];
var
subjects
=
{};
var
header
;
var
tbHeader
;
...
...
@@ -387,58 +386,29 @@ function getMessageThreads(sub, max) {
&&
header
.
to_ext
!=
user
.
number
)
||
threadedMessages
.
indexOf
(
header
.
number
)
>=
0
)
continue
;
md5subject
=
md5_calc
(
header
.
subject
.
toUpperCase
().
replace
(
/
\s
*RE:
\s
*/g
,
''
),
hex
=
true
);
if
(
header
.
thread_back
!==
null
&&
threadedMessages
.
indexOf
(
header
.
thread_back
)
>=
0
)
{
if
(
threads
.
thread
.
hasOwnProperty
(
header
.
thread_back
))
{
// This is a reply to the first message in a thread
threads
.
thread
[
header
.
thread_back
].
newest
=
header
.
when_written_time
;
threads
.
dates
[
threads
.
thread
[
header
.
thread_back
].
dateIndex
]
=
header
.
when_written_time
;
threads
.
thread
[
header
.
thread_back
].
messages
.
push
(
header
);
threadedMessages
.
push
(
header
.
number
);
}
else
{
tbHeader
=
msgBase
.
get_msg_header
(
header
.
thread_back
);
if
(
tbHeader
!==
null
)
{
// Heh - yeah, this part still sucks
outer
:
for
(
var
t
in
threads
.
thread
)
{
for
(
var
mm
in
threads
.
thread
[
t
].
messages
)
{
if
(
threads
.
thread
[
t
].
messages
[
mm
].
number
!=
tbHeader
.
number
)
continue
;
threads
.
thread
[
t
].
newest
=
header
.
when_written_time
;
threads
.
dates
[
threads
.
thread
[
t
].
dateIndex
]
=
header
.
when_written_time
;
threads
.
thread
[
t
].
messages
.
push
(
header
);
threadedMessages
.
push
(
header
.
number
);
break
outer
;
}
}
}
}
if
(
header
.
thread_id
!==
header
.
number
&&
threads
.
thread
.
hasOwnProperty
(
header
.
thread_id
))
{
threads
.
thread
[
header
.
thread_id
].
newest
=
header
.
when_written_time
;
threads
.
dates
[
threads
.
thread
[
header
.
thread_id
].
dateIndex
]
=
header
.
when_written_time
;
threads
.
thread
[
header
.
thread_id
].
messages
.
push
(
header
);
}
else
if
(
subjects
.
hasOwnProperty
(
md5subject
))
{
// Attempt to match an existing thread based on the subject line
threads
.
thread
[
subjects
[
md5subject
]].
newest
=
header
.
when_written_time
;
threads
.
dates
[
threads
.
thread
[
subjects
[
md5subject
]].
dateIndex
]
=
header
.
when_written_time
;
threads
.
thread
[
subjects
[
md5subject
]].
messages
.
push
(
header
);
threadedMessages
.
push
(
header
.
number
);
}
if
(
thread
edMessages
.
indexOf
(
header
.
number
)
>=
0
)
continue
;
// This is a new thread
threads
.
dates
.
push
(
header
.
when_written_time
);
thr
ead
s
.
thread
[
header
.
number
]
=
{
n
ewest
:
header
.
when_written_time
,
dateIndex
:
threads
.
dates
.
length
-
1
,
messages
:
[
header
]
}
else
{
threads
.
dates
.
push
(
header
.
when_written_time
);
thread
s
.
thread
[
header
.
thread_id
]
=
{
newest
:
header
.
when_written_time
,
dateIndex
:
threads
.
dates
.
length
-
1
,
messages
:
[
header
]
}
subjects
[
md5subject
]
=
h
ead
er
.
thread
_id
;
n
++
;
if
(
max
>
0
&&
n
>=
max
)
break
;
}
subjects
[
md5subject
]
=
header
.
number
;
threadedMessages
.
push
(
header
.
number
);
n
++
;
if
(
max
>
0
&&
n
>=
max
)
break
;
}
msgBase
.
close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment