Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 924 Bytes

README.md

File metadata and controls

32 lines (21 loc) · 924 Bytes

Swift 4.2 Git

JWZThreading

Implementation of the JWZ algorithm for threading email messages as described by Jamie Zawinski at http://www.jwz.org/doc/threading.html.

Usage

import JWZThreading

// Create an array of messages
let messages = downloadedMessages.map({
    JWZMessage(id: $0.header.messageID, message: $0, inReplyTo: $0.header.inReplyTo, references: $0.header.references)
})

// Call `thread(from:)` with a list of messages
let threads = JWZThread.thread(from: messages)

// Output the result
for container in threads {
    print(container.message?.id, container.children.count)
}

License

This project is licensed under the MIT License - see the LICENSE file for details