Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/252 ICAccount info #254

Merged
merged 12 commits into from
Jul 19, 2019
Prev Previous commit
Next Next commit
Recategorization and little code beautification
timgarrels committed Jul 15, 2019
commit 7f1dbd5d310ebc59845eeca7a18dd6b8a1dc1d81
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
defaultStreamClass

^ SocketStream
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
constants
folderNameOfTrash

^ 'Trash'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
error handling
checkForParameterError

(self fatalErrorOccured)
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ checkLoggedIn
(self fatalErrorOccured)
ifTrue: [^ false].

self isLoggedIn ifFalse: [
self loggedIn ifFalse: [
self fatalErrorOccured: true.
^ false].

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
login
connection
close

self stream close.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
connect

self connectWith: SocketStream
self connectWith: self class defaultStreamClass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
storage
createEmailsWith: maildirDirectory andName: directoryName and: relativeRootFolder

"this loads mails from storage and create ICFolder with ICMails in it."
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@ deleteEmail: anEmail

self sendCommand: (self class deleteEmail: anEmail messageID).
self fetchNextResponse.
self moveEmail: anEmail to: self folderNameOfTrash
self moveEmail: anEmail to: self class folderNameOfTrash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error handling
accessing
fatalErrorOccured: aBoolean

"If an error occured, that makes it impossible for a connection to be established,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error handling
accessing
fatalErrorOccured

"If an error occured, that makes it impossible for a connection to be established,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
login
fillBodyFor: anEmail

self
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
login
connection
isConnected

^ self stream isConnected

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
login
storage
loadEmailsFromMaildir

| directory directoryName |
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
connection
fetching
maildirDiffFetchHeadersFrom: anUID

"fetch headers in range (anUID, self uids last("

self uids ifEmpty: [ ^ OrderedCollection new].

self uids
ifEmpty: [ ^ OrderedCollection new];
ifNil: [^ OrderedCollection new]
ifNotNil: [^ self maildirDiffFetchHeadersFrom: (anUID + 1) to: (self uids last + 1)]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
fetching
maildirDiffFetchHeadersFrom: start to: end

| searchBegin searchEnd mailFolder |
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
storage
maildirFileName

"replace hierarchyDelimiter with FileSystem slash"
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ refreshConnectionProcess

delayTime := 60 * 10. "Wait for 10 minutes."

[self isConnected and: [self isLoggedIn]]
[self isConnected and: [self loggedIn]]
whileTrue: [
self sendCommand: self class noopCommand.
self fetchNextResponse.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
rootFolderName

"this accounts are saved with a hashed name, because we could otherwise get problems with
special tokens like @ or spaces in server-host or username"
"the account is saved with a hashed name, because otherwise problems with
special tokens like @ or spaces in server-host or username could occur"

^ ICHelper hashNameForAccount: (self accountInfo host) and: (self accountInfo username)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
accessing
uids: anOrderedCollection

uids := anOrderedCollection
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
connection
accessing
uids

^ uids
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
"commandSucceeded" : "C.G. 7/25/2018 14:10",
"connectionConfigurations" : "tg 7/8/2019 15:14",
"connectionConfigurations:" : "pm 6/19/2019 14:49",
"defaultStreamClass" : "tg 7/15/2019 13:26",
"deleteEmail:" : "C.G. 7/25/2018 14:10",
"errorBadParameter" : "jwe 7/28/2016 11:12",
"errorBadProtocol" : "js 5/15/2016 13:55",
@@ -23,6 +24,7 @@
"fetchBodyCommand:" : "lvm 5/8/2018 11:09",
"fetchFlagsWithUIDRange:to:" : "C.G. 7/25/2018 14:10",
"fetchHeadersWithUIDRange:to:" : "C.G. 7/25/2018 14:11",
"folderNameOfTrash" : "tg 7/15/2019 12:42",
"lastHeaderLine" : "jwe 7/14/2016 09:19",
"listCommand" : "js 6/8/2016 15:36",
"loginCommand" : "js 6/7/2016 09:55",
@@ -48,31 +50,29 @@
"checkConnected" : "tg 7/10/2019 19:29",
"checkForBadRequest" : "C.G. 7/25/2018 12:30",
"checkForParameterError" : "DH 7/25/2018 17:29",
"checkLoggedIn" : "C.G. 7/25/2018 12:42",
"checkLoggedIn" : "tg 7/15/2019 12:44",
"close" : "AR 5/31/2016 11:12",
"commandSucceeded" : "AR 6/14/2016 08:46",
"connect" : "tg 7/10/2019 19:02",
"connect" : "tg 7/15/2019 13:27",
"connectAndLoginWith:" : "tg 7/15/2019 12:28",
"connectWith:" : "tg 7/15/2019 12:21",
"createEmailsWith:andName:and:" : "C.G. 6/26/2018 10:51",
"currentFolderName" : "C.G. 7/25/2018 13:50",
"currentFolderName:" : "C.G. 7/25/2018 13:50",
"currentUIDs" : "pm 6/3/2019 18:35",
"currentUIDsFor:" : "pm 6/3/2019 18:35",
"deleteEmail:" : "C.G. 7/4/2018 14:21",
"deleteEmail:" : "tg 7/15/2019 12:42",
"expungeEmail" : "mw 6/22/2018 23:00",
"fatalErrorOccured" : "pm 6/9/2019 13:10",
"fatalErrorOccured:" : "C.G. 7/25/2018 12:33",
"fetchMailsBeginningAt:number:" : "pm 6/3/2019 18:33",
"fetchNextResponse" : "C.G. 7/25/2018 13:51",
"fillBodyFor:" : "ms 7/10/2016 14:09",
"folderFromResponse:" : "C.G. 7/25/2018 13:51",
"folderNameOfTrash" : "mw 6/23/2018 12:08",
"folderPathFrom:" : "DH 7/4/2018 13:14",
"hierarchyDelimiter" : "mw 5/11/2018 10:37",
"hierarchyDelimiter:" : "mw 5/11/2018 10:37",
"isConnected" : "js 6/7/2016 10:13",
"isLoggedIn" : "js 5/15/2016 13:09",
"lastResponse" : "pm 6/9/2019 13:10",
"lastResponse:" : "lvm 5/24/2018 10:16",
"listAllFolders" : "js 6/14/2016 12:31",
@@ -82,7 +82,7 @@
"loggedIn:" : "js 5/15/2016 13:09",
"login" : "tg 7/10/2019 17:25",
"logout" : "js 6/14/2016 16:59",
"maildirDiffFetchHeadersFrom:" : "DH 7/25/2018 00:35",
"maildirDiffFetchHeadersFrom:" : "tg 7/15/2019 13:31",
"maildirDiffFetchHeadersFrom:to:" : "C.G. 7/25/2018 13:54",
"maildirFileName" : "pm 6/3/2019 18:33",
"moveEmail:to:" : "DH 7/9/2018 21:29",
@@ -102,15 +102,15 @@
"parseMethods" : "C.G. 7/25/2018 13:57",
"ping" : "AR 6/26/2016 15:04",
"preventTimeout" : "lvm 7/23/2018 23:33",
"refreshConnectionProcess" : "C.G. 7/25/2018 13:58",
"refreshConnectionProcess" : "tg 7/15/2019 12:44",
"resetFlag:and:" : "mw 5/17/2018 20:49",
"responseIsError" : "js 6/7/2016 10:16",
"responseIsParameterError" : "js 8/4/2017 22:25",
"responseIsWarning" : "AR 6/30/2016 07:54",
"retrieveFlagsFrom:to:in:" : "C.G. 7/25/2018 13:58",
"rootFolder" : "pm 6/9/2019 13:09",
"rootFolder:" : "js 6/10/2016 15:09",
"rootFolderName" : "tg 7/10/2019 17:27",
"rootFolderName" : "tg 7/15/2019 12:45",
"select:" : "C.G. 6/28/2018 10:30",
"sendCommand:" : "DH 6/26/2018 20:21",
"setFlag:and:" : "C.G. 7/25/2018 13:58",