diff --git a/packages/IMAPClient-Core.package/ICEmail.class/instance/maildirFileName.st b/packages/IMAPClient-Core.package/ICEmail.class/instance/maildirFileName.st new file mode 100644 index 00000000..9204c15d --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEmail.class/instance/maildirFileName.st @@ -0,0 +1,7 @@ +accessing +maildirFileName + ^ 'Maildir' , + FileDirectory slash, + self folder endpoint serverInfo host asString, + FileDirectory slash, + self folder path copyReplaceAll: '.' with: '_' \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEmail.class/instance/saveInMaildir.st b/packages/IMAPClient-Core.package/ICEmail.class/instance/saveInMaildir.st index 43e16503..32ef69c6 100644 --- a/packages/IMAPClient-Core.package/ICEmail.class/instance/saveInMaildir.st +++ b/packages/IMAPClient-Core.package/ICEmail.class/instance/saveInMaildir.st @@ -1,7 +1,6 @@ accessing saveInMaildir - - ICFileReadWriter new + ^ ICFileReadWriter new write: self - in: ('Maildir' , FileDirectory slash , self folder endpoint serverInfo host asString , FileDirectory slash , self folder path copyReplaceAll: '.' with: '_') + in: self maildirFileName as: self uid \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEmail.class/methodProperties.json b/packages/IMAPClient-Core.package/ICEmail.class/methodProperties.json index fa0e833a..2541d333 100644 --- a/packages/IMAPClient-Core.package/ICEmail.class/methodProperties.json +++ b/packages/IMAPClient-Core.package/ICEmail.class/methodProperties.json @@ -17,11 +17,12 @@ "header:" : "js 6/14/2016 10:39", "headerAsString" : "ms 7/28/2016 15:12", "initialize" : "AR 6/10/2016 11:10", + "maildirFileName" : "js 8/4/2017 23:20", "messageID" : "ms 7/10/2016 13:59", "messageID:" : "ms 7/10/2016 13:59", "minimalHeaderAsString" : "AR 7/28/2016 14:39", "retrieveBody" : "dl 7/20/2017 12:44", - "saveInMaildir" : "MW 8/4/2017 22:08", + "saveInMaildir" : "js 8/4/2017 23:20", "subject" : "ms 6/28/2016 10:08", "subject:" : "AR 6/13/2016 17:25", "to" : "AR 6/13/2016 17:27", diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/class/fetchHeaderCommand..st b/packages/IMAPClient-Core.package/ICEndPoint.class/class/fetchHeaderCommand..st index ad388394..5cf38c22 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/class/fetchHeaderCommand..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/class/fetchHeaderCommand..st @@ -1,4 +1,8 @@ commands fetchHeaderCommand: messageId - ^ {self protocolCommandStart . 'FETCH' . messageId . '(body[HEADER.FIELDS (from to subject date)])'} joinSeparatedBy: self protocolBlank \ No newline at end of file + ^ {self protocolCommandStart. + 'FETCH'. + messageId. + '(body[HEADER.FIELDS (from to subject date)])'} + joinSeparatedBy: self protocolBlank \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/createEmailsWith.andName..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/createEmailsWith.andName..st new file mode 100644 index 00000000..f78fb8dd --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/createEmailsWith.andName..st @@ -0,0 +1,21 @@ +connection +createEmailsWith: maildir_directory andName: directory_name + | server_directory filereader existing_emails email folder | + server_directory := maildir_directory directoryNamed: directory_name. + filereader := ICFileReadWriter new. + (server_directory directoryNames) do: + [ :foldername | + existing_emails := OrderedCollection new. + folder := ((ICFolder new) name: foldername; + emails: existing_emails; + endpoint: self; yourself). + self rootFolder addFolder: folder. + (server_directory directoryNamed: foldername) fileNames do: + [ :filename | + + Transcript show: 'folderName:' , (directory_name, FileDirectory slash, foldername); cr. + email := (filereader get: filename in: ('Maildir', FileDirectory slash, directory_name, FileDirectory slash, foldername)). + email folder: folder. + existing_emails add: email ]]. + + ^ existing_emails. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersFrom.to..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersFrom.to..st index 42e4223a..1f44b07a 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersFrom.to..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersFrom.to..st @@ -1,42 +1,13 @@ fetching fetchHeadersFrom: aBeginId to: anEndId - - | uidSize start end filename files files2 currentMails | - + | start end | self getCurrentUIDs. - uidSize := uids size. - - aBeginId > uidSize + aBeginId > (self uids size) ifTrue: [ ^ OrderedCollection new ]. - anEndId = '*' - ifTrue: [ start := uids first ] - ifFalse: [ anEndId > uidSize - ifTrue: [start := uids first ] - ifFalse: [start := uids at: uidSize - anEndId + 1 ] ]. - - end := uids at: uidSize - aBeginId + 1. - filename := 'Maildir' , FileDirectory slash, (self serverInfo host replaceAll: '.' with: '_') , FileDirectory slash , self currentFolderName. - Transcript show: filename; - cr. - Transcript show: end; - cr. - files := (FileDirectory uri: filename) - fileNamesMatching: end. - files2 := (FileDirectory uri: filename) - fileNamesMatching: start. - Transcript show: files; - cr; - show: files2; - cr. - files size > 0 & (files2 size > 0) - ifTrue: [Transcript show: 'Do nothing. Newest Mailrange already loaded'. - currentMails := rootFolder - childFolderNamed: self currentFolderName - ifAbsent: [OrderedCollection new]. - currentMails := currentMails emails. - ^ currentMails]. - ^ self - sendCommand: (self class fetchHeadersWithUIDRange: start to: end); - fetchNextResponse; - parseFetchHeaders: self lastResponse \ No newline at end of file + ifTrue: [ start := self uids first ] + ifFalse: [ anEndId > (self uids size) + ifTrue: [start := self uids first ] + ifFalse: [start := self uids at: (self uids size) - anEndId + 1 ] ]. + end := self uids at: (self uids size) - aBeginId + 1. + ^ self maildirDiffFetchHeadersFrom: start to: end \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn..st deleted file mode 100644 index e71618ef..00000000 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn..st +++ /dev/null @@ -1,13 +0,0 @@ -fetching -fetchHeadersIn: aFolder - | selectResponse isNotEmpty| - selectResponse := self select: aFolder path. - - isNotEmpty := true. - (self lastResponse do: - [:line | (line findString: '0 EXISTS') > 0 - ifTrue: [isNotEmpty := false]]). - - isNotEmpty - ifTrue: [^self fetchAllHeadersOfSelectedFolder collect: [ :email | email folder: aFolder ]] - ifFalse: [Transcript show: (aFolder name), ' is an empty folder!'. ^OrderedCollection new.]. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn.for..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn.for..st index a4eeeead..af36d0e1 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn.for..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchHeadersIn.for..st @@ -2,12 +2,10 @@ fetching fetchHeadersIn: aFolder for: aNumber | selectResponse isNotEmpty| selectResponse := self select: aFolder path. - isNotEmpty := true. (self lastResponse do: [:line | (line findString: '0 EXISTS') > 0 ifTrue: [isNotEmpty := false]]). - isNotEmpty ifTrue: [^(self fetchHeadersFrom: 1 to: aNumber) collect: [ :email | email folder: aFolder ]] ifFalse: [Transcript show: (aFolder name), ' is an empty folder!'. ^OrderedCollection new.]. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchNextResponse.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchNextResponse.st index 21c945b6..87a10692 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchNextResponse.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/fetchNextResponse.st @@ -1,6 +1,5 @@ fetching fetchNextResponse - | multiLineResponse | multiLineResponse := OrderedCollection new. self stream nextResponse. @@ -10,4 +9,4 @@ fetchNextResponse multiLineResponse add: self stream lastResponse. self stream nextResponse ]. - self lastResponse: multiLineResponse "if multiLineResponse is empty but no error was risen, all we got was a single line of response containing something like '. OK ...'" \ No newline at end of file + self lastResponse: multiLineResponse \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/folderFromResponse..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/folderFromResponse..st index 5d344080..dbf87e78 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/folderFromResponse..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/folderFromResponse..st @@ -1,13 +1,9 @@ protocol parse folderFromResponse: responseLine - | folderPath parent | folderPath := self folderPathFrom: responseLine. - Transcript show: 'folderPath'; show: folderPath; cr. parent := self rootFolder childFolderNamed: folderPath first ifAbsent: [ ICFolder named: folderPath first in: self rootFolder with: self ]. - Transcript show: 'parent'; show: parent; cr. - folderPath allButFirst do: [ :name | parent := parent childFolderNamed: name ifAbsent: [ ICFolder named: name in: parent with: self ]]. diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getAllUIDs.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getAllUIDs.st deleted file mode 100644 index 40582694..00000000 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getAllUIDs.st +++ /dev/null @@ -1,11 +0,0 @@ -fetching -getAllUIDs - - self - sendCommand: self class getAllUIDs; - fetchNextResponse. - - uids := ((self lastResponse at: 1) subStrings: ' ') asOrderedCollection - removeFirst; - removeFirst; - yourself \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getCurrentUIDs.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getCurrentUIDs.st index ccdb46c0..143a67c0 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getCurrentUIDs.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/getCurrentUIDs.st @@ -1,11 +1,9 @@ fetching getCurrentUIDs - self sendCommand: self class getAllUIDs; fetchNextResponse. - - uids := ((self lastResponse at: 1) subStrings: ' ') asOrderedCollection + self uids: (((self lastResponse at: 1) subStrings: ' ') asOrderedCollection removeFirst; removeFirst; - yourself \ No newline at end of file + yourself) \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter..st index 36a86f3a..f3d175e9 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter..st @@ -1,6 +1,5 @@ accessing hierarchyDelimiter: aSymbol - - hierachyDelimiter := aSymbol + hierarchyDelimiter := aSymbol \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter.st index 86f61138..179d9e41 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/hierarchyDelimiter.st @@ -1,5 +1,4 @@ accessing hierarchyDelimiter - - ^ hierachyDelimiter + ^ hierarchyDelimiter \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/initialize.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/initialize.st index cf1675d9..cfc2a34f 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/initialize.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/initialize.st @@ -1,6 +1,5 @@ initialization initialize - super initialize. self loggedIn: false; diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/listFoldersIn.using..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/listFoldersIn.using..st index db79bf38..19807bd0 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/listFoldersIn.using..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/listFoldersIn.using..st @@ -1,10 +1,11 @@ message handling listFoldersIn: root using: filter - self checkConnected; checkLoggedIn. - - self stream sendCommand: ({ self class listCommand . self class asProtocolQuote: root . self class asProtocolQuote: filter } joinSeparatedBy: self class protocolBlank). - + self stream sendCommand: ( + {self class listCommand. + self class asProtocolQuote: root. + self class asProtocolQuote: filter} + joinSeparatedBy: self class protocolBlank). ^ self parseListResponse \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsFromMaildir.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsFromMaildir.st index 3eddfac2..07a30e53 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsFromMaildir.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsFromMaildir.st @@ -1,16 +1,11 @@ login -loadEmailsFromMaildir - - | directory_name server_directory filereader | - - directory_name := (self serverInfo host) copyReplaceAll: '.' with: '_'. - (self maildirDirectory directoryExists: directory_name) - ifFalse: [ - Transcript show: 'Maildir doesnt exist'. - ^ (OrderedCollection new) ]. - - server_directory := self maildirDirectory directoryNamed: directory_name. - - filereader := ICFileReadWriter new. - (server_directory directoryNames) do: - [ :foldername | self loadEmailsInFolder: foldername andDirectory: server_directory ] \ No newline at end of file +loadEmailsFromMaildir + | directory_name maildir_directory default_directory | + default_directory := FileDirectory default. + (default_directory directoryExists: 'Maildir') + ifFalse: [default_directory createDirectory: 'Maildir']. + maildir_directory := default_directory directoryNamed: 'Maildir'. + directory_name := (self serverInfo host) copyReplaceAll: '.' with: '_'. + (maildir_directory directoryExists: directory_name) + ifFalse: [ Transcript show: 'Maildir doesnt exist'. ^ (OrderedCollection new) ]. + ^ self createEmailsWith: maildir_directory andName: directory_name. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsInFolder.andDirectory..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsInFolder.andDirectory..st deleted file mode 100644 index 1f78b6df..00000000 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/loadEmailsInFolder.andDirectory..st +++ /dev/null @@ -1,17 +0,0 @@ -login -loadEmailsInFolder: aFolder andDirectory: aDirectory - - | existing_emails filereader folder email | - - filereader := ICFileReadWriter new. - existing_emails := OrderedCollection new. - folder := ((ICFolder new) name: aFolder; - emails: existing_emails; - endpoint: self; yourself). - self rootFolder addFolder: folder. - ((aDirectory directoryNamed: aFolder) fileNames do: - [ :filename | - email := (filereader get: filename in: (aDirectory, FileDirectory slash, aFolder)). - email folder: folder. - existing_emails add: email ]). - ^ existing_emails \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/login.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/login.st index 944acd12..2ebc4144 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/login.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/login.st @@ -1,15 +1,14 @@ message handling login - self checkConnected. - self authenticationInfo isValid ifFalse: [ ^ false ]. - - self - sendCommand: ({ self class loginCommand . self authenticationInfo username . self authenticationInfo password } joinSeparatedBy: self class protocolBlank); - fetchNextResponse; - loggedIn: self commandSucceeded; - checkLoggedIn. - - self - loadEmailsFromMaildir. - ^ true \ No newline at end of file + self authenticationInfo isValid ifFalse: [ ^ false ]. + self sendCommand: ( + { self class loginCommand. + self authenticationInfo username. + self authenticationInfo password } + joinSeparatedBy: self class protocolBlank); + fetchNextResponse; + loggedIn: self commandSucceeded; + checkLoggedIn. + self loadEmailsFromMaildir. + ^ true \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirDiffFetchHeadersFrom.to..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirDiffFetchHeadersFrom.to..st new file mode 100644 index 00000000..0843eac6 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirDiffFetchHeadersFrom.to..st @@ -0,0 +1,19 @@ +connection +maildirDiffFetchHeadersFrom: start to: end + | searchBegin searchEnd currentMails | + searchBegin := (FileDirectory uri: self maildirFileName) + fileNamesMatching: end. + searchEnd := (FileDirectory uri: self maildirFileName) + fileNamesMatching: start. + + searchBegin size > 0 & (searchEnd size > 0) + ifTrue: [Transcript show: 'Do nothing. Newest Mailrange already loaded'. + currentMails := rootFolder + childFolderNamed: self currentFolderName + ifAbsent: [OrderedCollection new]. + currentMails := currentMails emails. + ^ currentMails]. + ^ self + sendCommand: (self class fetchHeadersWithUIDRange: start to: end); + fetchNextResponse; + parseFetchHeaders: self lastResponse \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirDirectory.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirDirectory.st deleted file mode 100644 index e4aa5165..00000000 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirDirectory.st +++ /dev/null @@ -1,7 +0,0 @@ -maildir -maildirDirectory - - (FileDirectory default directoryExists: 'Maildir') - ifFalse: [FileDirectory default createDirectory: 'MailDir']. - - ^ FileDirectory default directoryNamed: 'Maildir' \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirFileName.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirFileName.st new file mode 100644 index 00000000..4eb76fda --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/maildirFileName.st @@ -0,0 +1,7 @@ +connection +maildirFileName + ^ 'Maildir' , + FileDirectory slash, + (self serverInfo host replaceAll: '.' with: '_'), + FileDirectory slash, + self currentFolderName. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeader.withId..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeader.withId..st index cb3131ef..4053ad43 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeader.withId..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeader.withId..st @@ -1,12 +1,9 @@ protocol parse parseFetchHeader: headerLines withId: id - | email headerData headerChunk | - email := ICEmail new. email messageID: id. - "(headerLines first subStrings: ' ') second." - headerData := headerLines subStrings: ((Character cr) asString) ." copyFrom: 2 to: headerLines size - 2.". + headerData := headerLines subStrings: ((Character cr) asString) . headerChunk := OrderedCollection new. headerData do: [ :line | diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeaders..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeaders..st index c5b9dbb9..00b638a3 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeaders..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseFetchHeaders..st @@ -1,19 +1,10 @@ protocol parse parseFetchHeaders: headerLines - | parser folder | + | parser folder| parser := (ICFetchResponseParser new) endpoint: self. - headerLines do: [:x | x do: [:i | parser read: i]. parser read: (Character cr) ]. - folder := self rootFolder childFolderNamed: (self currentFolderName ). parser emails do: [:mail | mail folder: folder; saveInMaildir ]. - "emailHeaderLines := OrderedCollection new. - headerLines do: [ :line | - emailHeaderLines add: line. - (line = self class lastHeaderLine) ifTrue: [ - emails add: (self parseFetchHeader: emailHeaderLines). - emailHeaderLines removeAll ] ]." - ^ parser emails. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseHeaderChunk.for..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseHeaderChunk.for..st index 6f9e1b45..813c208d 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseHeaderChunk.for..st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/parseHeaderChunk.for..st @@ -1,6 +1,5 @@ protocol parse parseHeaderChunk: aHeaderChunk for: anEmail - | headerField method | headerField := (aHeaderChunk first subStrings: ':') first. method := (self parseMethods at: headerField ifAbsent: nil). diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/responseIsParameterError.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/responseIsParameterError.st index d274e010..02200769 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/responseIsParameterError.st +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/responseIsParameterError.st @@ -1,4 +1,6 @@ error handling responseIsParameterError - ^ self class protocolParameterError = ((self stream lastResponse subStrings: self class protocolBlank) at: self class parameterErrorPosition) \ No newline at end of file + ^ self class protocolParameterError = + ((self stream lastResponse subStrings: self class protocolBlank) + at: self class parameterErrorPosition) \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/serverDirectoryPath.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/serverDirectoryPath.st new file mode 100644 index 00000000..c9312e68 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/serverDirectoryPath.st @@ -0,0 +1,11 @@ +connection +serverDirectoryPath + |default_directory maildir_directory directory_name | + default_directory := FileDirectory default. + (default_directory directoryExists: 'Maildir') + ifFalse: [default_directory createDirectory: 'Maildir']. + maildir_directory := default_directory directoryNamed: 'Maildir'. + directory_name := (self serverInfo host) copyReplaceAll: '.' with: '_'. + (maildir_directory directoryExists: directory_name) + ifFalse: [ Transcript show: 'Maildir doesnt exist'. ^ (OrderedCollection new) ]. + ^ maildir_directory directoryNamed: directory_name. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/uids..st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/uids..st new file mode 100644 index 00000000..d37f0479 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/uids..st @@ -0,0 +1,3 @@ +connection +uids: anObject + uids := anObject \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/instance/uids.st b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/uids.st new file mode 100644 index 00000000..53b2d93a --- /dev/null +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/instance/uids.st @@ -0,0 +1,3 @@ +connection +uids + ^ uids \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/methodProperties.json b/packages/IMAPClient-Core.package/ICEndPoint.class/methodProperties.json index 98f40687..67635f3e 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/methodProperties.json +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/methodProperties.json @@ -12,7 +12,7 @@ "errorNoPasswordSet" : "js 5/15/2016 13:51", "errorNoUsernameSet" : "js 5/15/2016 13:51", "fetchBodyCommand:" : "AR 6/13/2016 16:23", - "fetchHeaderCommand:" : "AR 6/13/2016 16:22", + "fetchHeaderCommand:" : "js 8/4/2017 22:25", "fetchHeadersWithRange:to:" : "al 7/4/2016 16:42", "fetchHeadersWithUIDRange:to:" : "MD 7/9/2017 23:04", "getAllUIDs" : "MD 7/16/2017 16:29", @@ -40,58 +40,58 @@ "connectTo:on:" : "jwe 7/28/2016 14:02", "connectTo:on:with:" : "jwe 7/28/2016 14:10", "connectTo:with:" : "ms 7/28/2016 13:07", + "createEmailsWith:andName:" : "js 8/5/2017 00:23", "currentFolderName" : "js 7/9/2017 21:12", "currentFolderName:" : "js 7/9/2017 21:13", "fetchAllHeadersOfSelectedFolder" : "js 6/4/2017 16:46", "fetchBody:" : "AR 6/13/2016 16:23", - "fetchHeadersFrom:to:" : "MW 8/4/2017 21:36", - "fetchHeadersIn:" : "js 6/12/2017 10:58", - "fetchHeadersIn:for:" : "dl 6/23/2017 13:37", + "fetchHeadersFrom:to:" : "js 8/4/2017 23:45", + "fetchHeadersIn:for:" : "js 8/4/2017 23:21", "fetchHeadersOfSelectedFolderFor:" : "dl 6/23/2017 13:30", - "fetchNextResponse" : "MW 8/4/2017 22:05", + "fetchNextResponse" : "js 8/4/2017 23:21", "fillBodyFor:" : "ms 7/10/2016 14:09", "fillBodyFor:with:" : "AR 6/15/2016 11:30", - "folderFromResponse:" : "js 7/9/2017 18:31", + "folderFromResponse:" : "js 8/4/2017 23:21", "folderPathFrom:" : "js 7/9/2017 19:12", - "getAllUIDs" : "dl 7/20/2017 12:25", - "getCurrentUIDs" : "dl 7/20/2017 12:30", - "hierarchyDelimiter" : "jwe 7/14/2016 09:17", - "hierarchyDelimiter:" : "jwe 7/14/2016 09:16", - "initialize" : "dl 7/20/2017 12:30", + "getCurrentUIDs" : "js 8/5/2017 00:00", + "hierarchyDelimiter" : "js 8/4/2017 23:52", + "hierarchyDelimiter:" : "js 8/4/2017 23:52", + "initialize" : "js 8/4/2017 23:21", "isConnected" : "js 6/7/2016 10:13", "isLoggedIn" : "js 5/15/2016 13:09", "lastHeaderLine" : "al 7/4/2016 16:59", "lastResponse" : "js 6/14/2016 10:38", "lastResponse:" : "js 6/14/2016 10:41", "listAllFolders" : "js 6/14/2016 12:31", - "listFoldersIn:using:" : "js 6/14/2016 10:41", - "loadEmailsFromMaildir" : "MW 8/4/2017 20:56", - "loadEmailsInFolder:andDirectory:" : "MW 8/4/2017 20:54", + "listFoldersIn:using:" : "js 8/4/2017 23:21", + "loadEmailsFromMaildir" : "js 8/4/2017 23:22", "loggedIn" : "js 5/15/2016 13:09", "loggedIn:" : "js 5/15/2016 13:09", - "login" : "js 7/9/2017 23:45", + "login" : "js 8/4/2017 23:27", "login:using:" : "js 5/15/2016 16:33", "loginUsing:" : "jwe 7/12/2016 10:19", "logout" : "js 6/14/2016 16:59", - "maildirDirectory" : "MW 8/4/2017 20:59", + "maildirDiffFetchHeadersFrom:to:" : "js 8/4/2017 23:45", + "maildirFileName" : "js 8/4/2017 23:20", "parseFetchBody" : "jwe 7/28/2016 11:39", - "parseFetchHeader:withId:" : "dl 7/31/2017 18:21", + "parseFetchHeader:withId:" : "js 8/4/2017 22:26", "parseFetchHeaderDate:for:" : "AR 6/27/2016 20:58", "parseFetchHeaderReceiver:for:" : "AR 6/29/2016 21:48", "parseFetchHeaderSender:for:" : "al 6/28/2016 11:10", "parseFetchHeaderSubject:for:" : "MD 7/9/2017 22:57", - "parseFetchHeaders:" : "MW 8/4/2017 22:08", - "parseHeaderChunk:for:" : "js 6/4/2017 17:39", + "parseFetchHeaders:" : "js 8/4/2017 22:26", + "parseHeaderChunk:for:" : "js 8/4/2017 22:26", "parseListResponse" : "ms 7/9/2016 17:43", "parseMethods" : "AR 6/27/2016 20:47", "ping" : "AR 6/26/2016 15:04", "responseIsError" : "js 6/7/2016 10:16", - "responseIsParameterError" : "jwe 7/19/2016 10:50", + "responseIsParameterError" : "js 8/4/2017 22:25", "responseIsWarning" : "AR 6/30/2016 07:54", "rootFolder" : "js 6/10/2016 15:09", "rootFolder:" : "js 6/10/2016 15:09", "select:" : "js 7/9/2017 21:20", "sendCommand:" : "js 6/12/2017 10:16", + "serverDirectoryPath" : "js 8/4/2017 22:30", "serverInfo" : "js 5/15/2016 16:45", "serverInfo:" : "js 5/15/2016 16:45", "ssl" : "ms 7/12/2016 10:35", @@ -99,4 +99,6 @@ "startsNewHeaderChunk:" : "AR 6/27/2016 16:04", "stream" : "js 6/7/2016 10:17", "stream:" : "js 6/7/2016 10:17", + "uids" : "js 8/4/2017 23:44", + "uids:" : "js 8/4/2017 23:44", "useSSL" : "ms 7/12/2016 10:35" } } diff --git a/packages/IMAPClient-Core.package/ICEndPoint.class/properties.json b/packages/IMAPClient-Core.package/ICEndPoint.class/properties.json index 2bf2dbd3..22483a97 100644 --- a/packages/IMAPClient-Core.package/ICEndPoint.class/properties.json +++ b/packages/IMAPClient-Core.package/ICEndPoint.class/properties.json @@ -13,8 +13,8 @@ "rootFolder", "lastResponse", "ssl", - "hierachyDelimiter", - "uids" ], + "uids", + "hierarchyDelimiter" ], "name" : "ICEndPoint", "pools" : [ ], diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails..st new file mode 100644 index 00000000..5cf12977 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails..st @@ -0,0 +1,3 @@ +accessing +emails: anObject + emails := anObject \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails.st index d3de1130..a2317a95 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails.st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/emails.st @@ -1,4 +1,3 @@ -as yet unclassified +accessing emails - ^ emails \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint..st index ec23b3b2..b87d954f 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint..st @@ -1,4 +1,3 @@ -as yet unclassified +accessing endpoint: anEndpoint - endpoint := anEndpoint \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint.st index ab7ac031..33992810 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint.st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/endpoint.st @@ -1,4 +1,3 @@ -as yet unclassified +accessing endpoint - ^ endpoint \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/initialize.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/initialize.st index ecd757f4..4a73b458 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/initialize.st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/initialize.st @@ -1,14 +1,17 @@ -as yet unclassified +initialization initialize - " - States: + "States: 1 : '*' 2: '* ' 3: '* {uid}' 4: '* {uid} ' - 5: '* {uid} (' - 6: '* {uid} ({body}' - " + 5: '* {uid} F' + 6: '* {uid} FE' + 7: '* {uid} FET' + 8: '* {uid} FETC' + 9: '* {uid} FETCH' + 10: '* {uid} FETCH ' + 11: '* {uid} FETCH ( $header_content )'" self state: 1. - emails := OrderedCollection new. + self emails: OrderedCollection new. self reset \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/parenthesesCounter..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/parenthesesCounter..st new file mode 100644 index 00000000..7fc58f29 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/parenthesesCounter..st @@ -0,0 +1,3 @@ +accessing +parenthesesCounter: counter + parenthesesCounter := counter \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/parenthesesCounter.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/parenthesesCounter.st new file mode 100644 index 00000000..0b09a8c5 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/parenthesesCounter.st @@ -0,0 +1,3 @@ +accessing +parenthesesCounter + ^ parenthesesCounter \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read..st index dbd09ae0..dfe4c298 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read..st @@ -1,15 +1,5 @@ -as yet unclassified +stateTransitions read: aChar - - (state = 1) ifTrue: [self read1: aChar] ifFalse: [ - (state = 2) ifTrue: [self read2: aChar] ifFalse: [ - (state = 3) ifTrue: [self read3: aChar] ifFalse: [ - (state = 4) ifTrue: [self read4: aChar] ifFalse: [ - (state = 5) ifTrue: [self read5: aChar] ifFalse: [ - (state = 6) ifTrue: [self read6: aChar] ifFalse: [ - (state = 7) ifTrue: [self read7: aChar] ifFalse: [ - (state = 8) ifTrue: [self read8: aChar] ifFalse: [ - (state = 9) ifTrue: [self read9: aChar] ifFalse: [ - (state = 10) ifTrue: [self read10: aChar] ifFalse: [ - (state = 11) ifTrue: [self read11: aChar] ifFalse: [ - (self throwError)]]]]]]]]]]] \ No newline at end of file + |nextTransition| + nextTransition := ('read', self state asString, ':') asSymbol. + self perform: nextTransition with: aChar. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read1..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read1..st index 5a2fc12b..e55a1624 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read1..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read1..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read1: aChar aChar == $* diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read10..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read10..st index f78c89cb..f3d98981 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read10..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read10..st @@ -1,7 +1,6 @@ -as yet unclassified +stateTransitions read10: aChar - aChar == $( - ifTrue: [ parentheses_counter := 1. + ifTrue: [self parenthesesCounter: (self parenthesesCounter +1). self state: 11 ] ifFalse: [ self throwError ] \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read11..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read11..st index 7fa158d8..fbfb9040 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read11..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read11..st @@ -1,16 +1,10 @@ -as yet unclassified +stateTransitions read11: aChar - aChar == $( - ifTrue: [ parentheses_counter := parentheses_counter + 1 ]. - + ifTrue: [ self parenthesesCounter: (self parenthesesCounter +1)]. aChar == $) - ifTrue: [ parentheses_counter := parentheses_counter - 1 ]. - - parentheses_counter = 0 - ifTrue: [ emails - add: (self endpoint parseFetchHeader: current_mail withId: current_uid). - self - state: 1; - reset ] - ifFalse: [current_mail := current_mail , aChar] \ No newline at end of file + ifTrue: [ self parenthesesCounter: (self parenthesesCounter - 1)]. + parenthesesCounter = 0 + ifTrue: [ self emails add: (self endpoint parseFetchHeader: currentMail withId: currentUid). + self state: 1; reset ] + ifFalse: [ currentMail := currentMail , aChar ] \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read2..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read2..st index dbba5806..874d4152 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read2..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read2..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read2: aChar aChar == Character space diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read3..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read3..st index 1f29e61c..d8b40f65 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read3..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read3..st @@ -1,8 +1,8 @@ -as yet unclassified +stateTransitions read3: aChar aChar isDigit - ifTrue: [ current_uid := current_uid , aChar. + ifTrue: [ currentUid := currentUid , aChar. self state: 3 ] ifFalse: [ aChar = Character space ifTrue: [ self state: 4 ] diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read4..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read4..st index 652a2ecf..e808f523 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read4..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read4..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read4: aChar aChar == $F diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read5..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read5..st index b4930c7c..ff72c059 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read5..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read5..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read5: aChar aChar == $E diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read6..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read6..st index a1962afb..473e1668 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read6..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read6..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read6: aChar aChar == $T diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read7..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read7..st index 76432c83..feff8581 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read7..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read7..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read7: aChar aChar == $C diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read8..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read8..st index 3efca35f..69cbae80 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read8..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read8..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read8: aChar aChar == $H diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read9..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read9..st index f5c40cba..5278186a 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read9..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/read9..st @@ -1,4 +1,4 @@ -as yet unclassified +stateTransitions read9: aChar aChar == Character space diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/reset.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/reset.st index ad669ca9..0e912765 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/reset.st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/reset.st @@ -1,5 +1,5 @@ -as yet unclassified +initialization reset - - current_uid := ''. - current_mail := '' \ No newline at end of file + currentUid := ''. + currentMail := ''. + self parenthesesCounter: 0. \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state..st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state..st index 487be7f2..963f529b 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state..st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state..st @@ -1,4 +1,4 @@ -as yet unclassified -state: aState +stateTransitions +state: anObject - state := aState \ No newline at end of file + state := anObject \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state.st new file mode 100644 index 00000000..577014e7 --- /dev/null +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/state.st @@ -0,0 +1,3 @@ +accessing +state + ^ state \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/throwError.st b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/throwError.st index f1488aea..186ee933 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/throwError.st +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/instance/throwError.st @@ -1,6 +1,5 @@ -as yet unclassified +stateTransitions throwError - | msg | - msg := 'Parsing Error in state ' , state. + msg := 'Parsing Error in state ' , self state. self error: msg \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/methodProperties.json b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/methodProperties.json index 54a3d8f5..55a8f8fd 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/methodProperties.json +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/methodProperties.json @@ -2,22 +2,26 @@ "class" : { }, "instance" : { - "emails" : "dl 7/20/2017 12:34", - "endpoint" : "dl 7/20/2017 12:43", - "endpoint:" : "dl 7/20/2017 12:34", - "initialize" : "dl 7/20/2017 12:43", - "read10:" : "dl 7/20/2017 12:37", - "read11:" : "dl 7/20/2017 12:39", + "emails" : "js 8/4/2017 23:10", + "emails:" : "MD 8/1/2017 18:11", + "endpoint" : "js 8/4/2017 23:10", + "endpoint:" : "js 8/4/2017 23:10", + "initialize" : "js 8/4/2017 23:24", + "parenthesesCounter" : "js 8/4/2017 23:48", + "parenthesesCounter:" : "js 8/4/2017 23:48", + "read10:" : "js 8/4/2017 23:57", + "read11:" : "js 8/4/2017 23:58", "read1:" : "dl 7/20/2017 12:39", "read2:" : "dl 7/20/2017 12:40", - "read3:" : "dl 7/20/2017 12:41", + "read3:" : "js 8/4/2017 23:49", "read4:" : "dl 7/20/2017 12:41", "read5:" : "dl 7/20/2017 12:41", "read6:" : "dl 7/20/2017 12:42", "read7:" : "dl 7/20/2017 12:42", "read8:" : "dl 7/20/2017 12:42", "read9:" : "dl 7/20/2017 12:42", - "read:" : "dl 7/20/2017 12:35", - "reset" : "dl 7/20/2017 12:43", - "state:" : "dl 7/20/2017 12:34", - "throwError" : "dl 7/20/2017 12:43" } } + "read:" : "js 8/4/2017 23:25", + "reset" : "js 8/4/2017 23:58", + "state" : "MD 8/1/2017 17:55", + "state:" : "MD 8/1/2017 18:07", + "throwError" : "js 8/4/2017 23:54" } } diff --git a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/properties.json b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/properties.json index 0ed92007..c7c3ae75 100644 --- a/packages/IMAPClient-Core.package/ICFetchResponseParser.class/properties.json +++ b/packages/IMAPClient-Core.package/ICFetchResponseParser.class/properties.json @@ -6,12 +6,12 @@ ], "commentStamp" : "", "instvars" : [ - "parentheses_counter", - "current_mail", - "current_uid", "state", "emails", - "endpoint" ], + "endpoint", + "parenthesesCounter", + "currentMail", + "currentUid" ], "name" : "ICFetchResponseParser", "pools" : [ ], diff --git a/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/createPathIfNotExisting..st b/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/createPathIfNotExisting..st deleted file mode 100644 index 0f973f8d..00000000 --- a/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/createPathIfNotExisting..st +++ /dev/null @@ -1,10 +0,0 @@ -write file -createPathIfNotExisting: aPath - - | current_directory | - current_directory := FileDirectory default. - (aPath subStrings: (FileDirectory slash)) reverseDo: - [ :path | - (current_directory directoryExists: path) ifFalse: [current_directory createDirectory: path]. - current_directory := current_directory directoryNamed: path.]. - ^ current_directory \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/get.in..st b/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/get.in..st index 2ad70b6c..ac60a7a1 100644 --- a/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/get.in..st +++ b/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/get.in..st @@ -1,11 +1,9 @@ read file get: aFile in: aFolder - | filestream jsonFile | filestream := FileStream readOnlyFileNamed: aFolder, FileDirectory slash, aFile asString. jsonFile := Json readFrom: filestream. filestream close. - ^ ICEmail new header: (self createHeaderFrom: (jsonFile at: 'header')); body: (jsonFile at: 'body'); diff --git a/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/write.in.as..st b/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/write.in.as..st index d6119a54..b320ccb7 100644 --- a/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/write.in.as..st +++ b/packages/IMAPClient-Core.package/ICFileReadWriter.class/instance/write.in.as..st @@ -1,19 +1,19 @@ write file write: anICEmail in: aFolder as: aString - - | json_object rendered_json directory | - json_object := JsonObject newFrom: { + | jsonFile renderedJson fileDirectory subDir | + jsonFile := JsonObject newFrom: { 'header' -> (self createJsonHeaderFrom: anICEmail header). 'body' -> anICEmail body. 'messageID' -> anICEmail messageID. 'uid' -> anICEmail uid}. + + fileDirectory := (FileDirectory startUp; default). + subDir := ((aFolder subStrings: (FileDirectory slash)) allButLast) joinSeparatedBy: (FileDirectory slash). + (fileDirectory directoryExists: subDir) + ifFalse: [ fileDirectory createDirectory: subDir ]. + (fileDirectory directoryExists: aFolder) + ifFalse: [ fileDirectory createDirectory: aFolder ]. - directory := self createPathIfNotExisting: aFolder. - - - rendered_json := Json render: json_object. - (FileStream forceNewFileNamed: (directory fullNameFor: aString)) do: - [ :stream | stream - nextPutAll: rendered_json; - flush; - close ] \ No newline at end of file + renderedJson := Json render: jsonFile. + FileStream forceNewFileNamed: (aFolder, FileDirectory slash, aString) do: + [ :stream | stream nextPutAll: renderedJson; flush; close ] \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFileReadWriter.class/methodProperties.json b/packages/IMAPClient-Core.package/ICFileReadWriter.class/methodProperties.json index 6f4359d7..9dd7a2fa 100644 --- a/packages/IMAPClient-Core.package/ICFileReadWriter.class/methodProperties.json +++ b/packages/IMAPClient-Core.package/ICFileReadWriter.class/methodProperties.json @@ -4,7 +4,6 @@ "instance" : { "createHeaderFrom:" : "dl 6/29/2017 20:54", "createJsonHeaderFrom:" : "dl 7/20/2017 09:54", - "createPathIfNotExisting:" : "MW 8/4/2017 22:57", - "get:in:" : "js 7/16/2017 18:36", + "get:in:" : "js 8/4/2017 23:25", "getRecipientsFrom:" : "dl 7/20/2017 09:54", - "write:in:as:" : "MW 8/4/2017 22:54" } } + "write:in:as:" : "js 8/4/2017 23:25" } } diff --git a/packages/IMAPClient-Core.package/ICFolder.class/class/named.in.with..st b/packages/IMAPClient-Core.package/ICFolder.class/class/named.in.with..st index 1ac56565..d4c310ea 100644 --- a/packages/IMAPClient-Core.package/ICFolder.class/class/named.in.with..st +++ b/packages/IMAPClient-Core.package/ICFolder.class/class/named.in.with..st @@ -1,11 +1,8 @@ instance creation named: name in: parent with: endpoint - | newFolder | - newFolder := self new. - newFolder + newFolder := (self new) name: name; endpoint: endpoint. - parent addFolder: newFolder. ^ newFolder \ No newline at end of file diff --git a/packages/IMAPClient-Core.package/ICFolder.class/instance/fetchHeaders.st b/packages/IMAPClient-Core.package/ICFolder.class/instance/fetchHeaders.st deleted file mode 100644 index f652eeb8..00000000 --- a/packages/IMAPClient-Core.package/ICFolder.class/instance/fetchHeaders.st +++ /dev/null @@ -1,5 +0,0 @@ -email access -fetchHeaders - - (self ~= self endpoint rootFolder) - ifTrue: [ self emails: (self endpoint fetchHeadersIn: self) ] diff --git a/packages/IMAPClient-Core.package/ICFolder.class/methodProperties.json b/packages/IMAPClient-Core.package/ICFolder.class/methodProperties.json index 56062103..3c4a3a86 100644 --- a/packages/IMAPClient-Core.package/ICFolder.class/methodProperties.json +++ b/packages/IMAPClient-Core.package/ICFolder.class/methodProperties.json @@ -3,7 +3,7 @@ "defaultName" : "js 6/7/2016 11:49", "errorChildDoesNotExist" : "js 6/14/2016 09:27", "named:in:" : "js 6/8/2016 15:22", - "named:in:with:" : "ms 7/10/2016 13:23", + "named:in:with:" : "js 8/4/2017 23:06", "newRootFolderWith:" : "ms 7/10/2016 13:53", "parseFromServer:" : "ms 7/28/2016 11:17", "textbasedHierarchyBlank" : "js 6/7/2016 12:55" }, @@ -20,7 +20,6 @@ "emails:" : "ms 6/28/2016 09:52", "endpoint" : "ms 7/10/2016 13:24", "endpoint:" : "ms 7/10/2016 13:24", - "fetchHeaders" : "ms 7/11/2016 14:30", "fetchHeadersFor:" : "dl 6/23/2017 13:34", "initialize" : "ms 6/28/2016 09:52", "name" : "js 6/7/2016 12:16", diff --git a/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/instance/testFillMessageBodyWithMultilineBody.st b/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/instance/testFillMessageBodyWithMultilineBody.st index 3d2817d9..9df29d56 100644 --- a/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/instance/testFillMessageBodyWithMultilineBody.st +++ b/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/instance/testFillMessageBodyWithMultilineBody.st @@ -4,6 +4,7 @@ testFillMessageBodyWithMultilineBody | email | email := ICEmail new. email messageID: 43. + email uid: 43. self endPoint fillBodyFor: email. self assert: (email body) equals: self class expectedFetchMultilineBody \ No newline at end of file diff --git a/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/methodProperties.json b/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/methodProperties.json index f93d0a81..a63917e8 100644 --- a/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/methodProperties.json +++ b/packages/IMAPClient-Tests.package/ICEndPointCommandTest.class/methodProperties.json @@ -29,7 +29,7 @@ "testFetchHeadersWithRange" : "al 7/4/2016 17:03", "testFetchHeadersWithUnlimitedRange" : "al 7/4/2016 17:21", "testFillMessageBody" : "js 8/4/2017 21:29", - "testFillMessageBodyWithMultilineBody" : "ms 7/10/2016 14:14", + "testFillMessageBodyWithMultilineBody" : "js 8/4/2017 22:01", "testListAllFolders" : "jwe 7/12/2016 10:09", "testLogout" : "jwe 6/21/2016 10:15", "testPing" : "jwe 6/21/2016 10:15", diff --git a/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/chooseNumberOfMails.st b/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/chooseNumberOfMails.st index 2795f038..22c7ba1b 100644 --- a/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/chooseNumberOfMails.st +++ b/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/chooseNumberOfMails.st @@ -1,4 +1,4 @@ -get emails +accessing chooseNumberOfMails | numberOfMails | diff --git a/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/fetchHeaderProcess.st b/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/fetchHeaderProcess.st index 29470e27..37efbe99 100644 --- a/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/fetchHeaderProcess.st +++ b/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/fetchHeaderProcess.st @@ -1,4 +1,4 @@ -get emails +accessing fetchHeaderProcess selectedFolder fetchHeadersFor: self numberOfHeadersToFetch. diff --git a/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/getEmailsIn..st b/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/getEmailsIn..st deleted file mode 100644 index 59180ba4..00000000 --- a/packages/IMAPClient-UI.package/ICFolderDialog.class/instance/getEmailsIn..st +++ /dev/null @@ -1,8 +0,0 @@ -get emails -getEmailsIn: aFolder - "Iterate through subfolders until you get only a folder back and fetch headers for that folder" - | subfolders | - - aFolder fetchHeaders. - subfolders := self subFoldersOf: aFolder. - subfolders do: [ :folder |self getEmailsIn: folder] \ No newline at end of file diff --git a/packages/IMAPClient-UI.package/ICFolderDialog.class/methodProperties.json b/packages/IMAPClient-UI.package/ICFolderDialog.class/methodProperties.json index 77151272..c45e6979 100644 --- a/packages/IMAPClient-UI.package/ICFolderDialog.class/methodProperties.json +++ b/packages/IMAPClient-UI.package/ICFolderDialog.class/methodProperties.json @@ -13,7 +13,6 @@ "fetchHeaderProcess" : "js 7/16/2017 18:16", "folderNameOf:" : "ms 6/26/2016 14:09", "getEmails" : "dl 6/29/2017 13:06", - "getEmailsIn:" : "js 6/6/2017 11:07", "labelFor:" : "js 7/16/2017 19:49", "numberOfHeadersToFetch" : "dl 6/23/2017 12:31", "numberOfHeadersToFetch:" : "dl 6/23/2017 13:33",