2022-04-11 15:05:21 +00:00
|
|
|
accessing
|
|
|
|
getLocalMessages
|
|
|
|
"TO DO! This method should return messages from the local database"
|
2022-04-14 21:43:31 +00:00
|
|
|
| allTweets myTweets tempTweets tempUsername |
|
2022-04-13 02:58:51 +00:00
|
|
|
|
2022-04-14 21:43:31 +00:00
|
|
|
tempUsername := self userName.
|
|
|
|
TweetsCollection storeDB.
|
2022-04-13 02:58:51 +00:00
|
|
|
allTweets := Tweet storedInstances asOrderedCollection.
|
|
|
|
allTweets ifNil: [ ^ nil ].
|
|
|
|
myTweets := TweetsCollection new.
|
2022-04-14 21:43:31 +00:00
|
|
|
tempTweets := allTweets select: [ :each | each timelines isNotEmpty and: [each timelines keys first = tempUsername] ].
|
|
|
|
myTweets tweets: tempTweets.
|
2022-04-13 02:58:51 +00:00
|
|
|
self tweets: myTweets.
|
2022-04-14 21:43:31 +00:00
|
|
|
^ {self tweets. self userName. tempTweets}
|
2022-04-13 02:58:51 +00:00
|
|
|
|