Spliting between local and remote messages. Minor UI improvements.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-11 10:05:21 -05:00
parent 2c2ee3b132
commit 89a73603a3
4 changed files with 29 additions and 23 deletions

View File

@ -0,0 +1,4 @@
accessing
getLocalMessages
"TO DO! This method should return messages from the local database"
^ nil

View File

@ -1,24 +1,4 @@
accessing
getMessages
| lastTweetsRaw customQuery lastTweets |
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
lastTweets := TweetsCollection new.
customQuery := Dictionary new
at: 'parameters' put: self userNameLink;
at: 'date' put: DateAndTime now;
yourself.
lastTweets query: customQuery.
lastTweetsRaw doWithIndex: [ :rssTweet :i | | current previous |
current := Tweet new fromNitterRssItem: rssTweet.
i < lastTweetsRaw size ifTrue: [
previous := Tweet new fromNitterRssItem: (lastTweetsRaw at: i + 1).
current timelines
at: self userName put: previous id;
yourself.
].
current queries add: customQuery.
lastTweets add: current.
].
self tweets: lastTweets.
^ self tweets
self getLocalMessages ifNil: [ self getRemoteMessages ].
^ self tweets

View File

@ -0,0 +1,22 @@
accessing
getRemoteMessages
| customQuery lastTweetsRaw lastTweets |
lastTweetsRaw := self rssFeed xmlDocument xpath: '//item'.
lastTweets := TweetsCollection new.
customQuery := Dictionary new
at: 'parameters' put: self userNameLink;
at: 'date' put: DateAndTime now;
yourself.
lastTweets query: customQuery.
lastTweetsRaw doWithIndex: [ :rssTweet :i |
| current previous |
current := Tweet new fromNitterRssItem: rssTweet.
i < lastTweetsRaw size ifTrue: [
previous := Tweet new fromNitterRssItem: (lastTweetsRaw at: i + 1).
current timelines
at: self userName put: previous id;
yourself ].
current queries add: customQuery.
lastTweets add: current ].
self tweets: lastTweets

View File

@ -17,7 +17,7 @@ gtTweetsFor: aView
background: Color white;
margin: (BlInsets all: 10);
constraintsDo: [ :c |
c vertical exact: 275.
c vertical exact: 200.
c horizontal exact: 480 ];
stencil: [ each asCardElement margin: (BlInsets all: 15) ].
container addChild: imageContainer