-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #542 from hpi-swa-teaching/fix/overlapping-messages
Make reply snippet update synchronous
- Loading branch information
Showing
28 changed files
with
74 additions
and
74 deletions.
There are no files selected for viewing
7 changes: 0 additions & 7 deletions
7
packages/TelegramClient-Core.package/TCCChat.class/instance/addAnsweredMessage..st
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
packages/TelegramClient-Core.package/TCCChat.class/instance/addMessage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
adding | ||
addMessage: aMessage | ||
|
||
self messageDictionary at: aMessage id ifAbsent: [ | ||
self messageDictionary at: aMessage id put: Promise new | ||
]. | ||
(self messageDictionary at: aMessage id) resolveWith: aMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
packages/TelegramClient-Core.package/TCCChat.class/instance/getMessageById..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
accessing | ||
getMessageById: aNumber | ||
|
||
^ self messageDictionary at: aNumber ifAbsent: [ | ||
self requestMessage: aNumber. | ||
^TCCNotLoadedMessage new] | ||
^ (self messageDictionary at: aNumber ifAbsent: [ | ||
self messageDictionary at: aNumber put: Promise new. | ||
self requestMessage: aNumber. | ||
self messageDictionary at: aNumber. | ||
]) | ||
wait; | ||
value |
6 changes: 5 additions & 1 deletion
6
packages/TelegramClient-Core.package/TCCChat.class/instance/messages.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
accessing | ||
messages | ||
|
||
^ self messageIds collect: [:aNumber | self messageDictionary at: aNumber] | ||
^ self messageIds collect: [:aNumber | | ||
(self messageDictionary at: aNumber) | ||
wait; | ||
value | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
packages/TelegramClient-UI.package/TCUUserMessage.class/instance/updateReplySnippet.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...s/TelegramClientTests-Core.package/TCTCChatTests.class/instance/testAddAnsweredMessage.st
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/TelegramClientTests-Core.package/TCTCChatTests.class/instance/testAddMessage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
testing | ||
testAddMessage | ||
|
||
| message | | ||
message := TCCTextMessage new id: 13. | ||
self chat addMessage: message. | ||
self assert: 5 equals: self chat messages size. | ||
self assert: message equals: (self chat getMessageById: 13) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
...Tests-UI.package/TCTUChatMessageListTests.class/instance/testScrollToReferencedMessage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
testing | ||
testScrollToReferencedMessage | ||
|
||
| referencedMessage referencingMessage referencedOffset replySnippet referencedTCUMessage | | ||
referencedMessage := (TCTMMocks mockTextMessageWith: self core withId: 1) text: 'Referenced Message'. | ||
referencingMessage := (TCTMMocks mockTextMessageWith: self core withId: 2 replyTo: 1) text: 'Referencing Message'. | ||
| referencedMessage referencingMessage referencedOffset | | ||
referencedMessage := (TCTMMocks mockTextMessageWith: self core withId: 1) | ||
text: 'Referenced Message'; | ||
chat: self subject chat. | ||
referencingMessage := (TCTMMocks mockTextMessageWith: self core withId: 2 replyTo: 1) | ||
text: 'Referencing Message'; | ||
chat: self subject chat. | ||
self subject chat addOldestMessage: referencedMessage. | ||
self subject chat addNewestMessage: referencingMessage. | ||
|
||
referencedTCUMessage := self subject scroller submorphs first. | ||
|
||
self subject scrollToShow: referencedTCUMessage. | ||
self subject scrollToShow: self subject scroller submorphs first. | ||
referencedOffset := self subject vScrollBar value. | ||
self subject scrollToNewestMessage. | ||
|
||
replySnippet := self subject findByClass: TCUReplySnippet. | ||
replySnippet click. | ||
(self subject findByClass: TCUReplySnippet) click. | ||
|
||
self assert: referencedOffset equals: self subject vScrollBar value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters