diff --git a/Socialmetrica.package/NitterUser.class/instance/avatarPicture.st b/Socialmetrica.package/NitterUser.class/instance/avatarPicture.st new file mode 100644 index 0000000..20ffe5d --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/avatarPicture.st @@ -0,0 +1,9 @@ +accessing +avatarPicture + | response | + response := ZnClient new url: (self profileImageUrl); get; response. + response contentType = ZnMimeType imageJpeg + ifTrue: [ ^ (JPEGReadWriter gtFromBuffer: response contents) asElement ]. + response contentType = ZnMimeType imagePng + ifTrue: [ ^ (PNGReadWriter gtFromBuffer: response contents) asElement ]. + ^ BlElement new background: Color gray \ No newline at end of file diff --git a/Socialmetrica.package/Tweet.class/instance/fromNitterTimelineItem..st b/Socialmetrica.package/Tweet.class/instance/fromNitterTimelineItem..st index 9911a6e..03a3f71 100644 --- a/Socialmetrica.package/Tweet.class/instance/fromNitterTimelineItem..st +++ b/Socialmetrica.package/Tweet.class/instance/fromNitterTimelineItem..st @@ -39,5 +39,5 @@ fromNitterTimelineItem: xmlItem metadata at: 'pinned' put: (((xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed) = 'Pinned Tweet' - ifTrue: [ True ] - ifFalse: [ False ]) \ No newline at end of file + ifTrue: [ true ] + ifFalse: [ false ]) \ No newline at end of file diff --git a/Socialmetrica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st b/Socialmetrica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st index 49c9da6..d479662 100644 --- a/Socialmetrica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st +++ b/Socialmetrica.package/TwitterUser.class/instance/gtViewProfileDetailsOn..st @@ -12,7 +12,7 @@ gtViewProfileDetailsOn: aView c vertical fitContent. c horizontal matchParent ]; padding: (BlInsets all: 10). - imageContainer := BlLazyElement new + imageContainer := self avatarPicture; withGlamorousPreview; aptitude: BrShadowAptitude new; background: Color white; diff --git a/Socialmetrica.package/TwitterUser.class/instance/profileImage.st b/Socialmetrica.package/TwitterUser.class/instance/profileImage.st index 686ba94..315065f 100644 --- a/Socialmetrica.package/TwitterUser.class/instance/profileImage.st +++ b/Socialmetrica.package/TwitterUser.class/instance/profileImage.st @@ -1,7 +1,8 @@ accessing profileImage - ^ BlUrlImageElement url: self profileImageUrl - "The previous version has something like - imageTemp on: Error do: [ ^ GtABContact new avatar ]. - ^ imageTemp value asElement - Should a generic avatar be reimplemented?" \ No newline at end of file + | imageTemp | + imageTemp := BrAsyncFileWidget new url: self profileImageUrl. + "Going back to the previous version after BlLazyElement that solved the issues was deprecated" + imageTemp on: Error do: [ ^ GtABContact new avatar ]. + ^ imageTemp value asElement + "Should a generic avatar be reimplemented?" \ No newline at end of file