Skip to content

Commit

Permalink
Feature/user list (#394)
Browse files Browse the repository at this point in the history
* test TCCCore callback and TCCUser constructor (+5 squashed commit)

Squashed commit:

[28b327f] refactor TCCCore

[153d794] Show message author in group chat notification

[54d9c3a] add user api call with callback for new messages

[fdb11cb] fix sender user id key in message constructor

[54f21dd] Message includes chat object (+1 squashed commits)

Squashed commits:

[f5056f3] show title of chat in notification

* use TCCChat>>newFromNewChatEvent constructor in TCCChatsHandler

* Notification shows sender, chat and more of the message

* TCCNullMessage does not rely on the chat inst var

* fixed most linter tests

* fix some remarks of PR #339

* test API assumptions

* integrate pr feedback

* fix last remarks of PR #339

* fixed most linter tests

* fixed typo in method names

* Swalint considered harmful

* test Notification

* You can't see me

* beautiful acceptance tests

* im done with this linter

* go return yourself

* test message chatID method

* exclude TCTAcceptanceTests from long method test in linter; remove too many inst vars test

* rename testing* -> mock* in TCTAcceptanceTests; use ifFalse in TCUNotification>>chatTitle

* Added class Users and updated Core for promise handling.

* Added test for getUserFor in TCCUsers.

* wip

* mwip

* introduce the first version of info pages for chats

* fix linter tests

* integrate users getUserFor: into TCCCore

* use TCTNoTDLibCore in acceptance tests

* fix spacing in TitleBar

* fix linter

* add TCT ui tests and distill mocks into separate class

* remove moved mocks from AcceptanceTests

* save test artifacts in pipeline

* add _builds to path of artifacts

* remove '/' and '-' from artifact name

* change hash to correct (pipeline) value

* add changes in main.yml. again.

* Editing Assert messages, created default values, and made expected screenshot test failures for Squeak 5.2

* Using NoTDLibCore now

* Added Morphic-Testing-Framework to Telegram Baseline and removing NoTDLibCore again

* Changing test phone number for further funny testing

* Fixing baseline

* WIP UI Test

* merge newest develop

* member count is now displayed when it finished loading, basicGroup member count is now correct

* add findByTextContent to MorphWrapper and write some tests for the popup

* Fixing the last test and adding a class comment

* Removing TCTMorphWrapper

* Solved merge conflicts

* Update main.yml again. Why is this being removen on every merge???

* ui test for chat member count

* test all chats in lists

* switch mouseUp to mouseDown

* fix regressions from merge

* add delays to MTF tests

* add vivide to baseline

* add vivide to baseline

* add initial version of Group description

* refactor info page description

* fixed merge

* load members for basicGroups

* fix merge

* user list - work in progress

* show chat member list

* adding member list with scroll bar

* fix linter

* refactoring of user list, some linter tests are failing, no idea why

* small user list changes

* refactor chats and groups

* delete file

* rename app to core

* add user loading

* fix merge issues

* fix tests

* User List tests

* fix load more button of user list

* addmock

* add the 2 most beautiful tests ever created

* add missing tests

* fix tests

* fix tests

* fix whitespaces

* remove conflict marker

* fix image hash for chat info page

* fix some pr remarks

* delete Tests package

* fixing most of the change requests

* fixing trailing whitespaces

* replace screenshot hash

* fix last requests

* fix pr remarks

* remove test package for the 1000th time

Co-authored-by: permler <paul.ermler@student.hpi.uni-potsdam.de>
Co-authored-by: Philipp Keese <philipp.keese@student.hpi.de>
Co-authored-by: Raphael Kunert <this.is-not@my.email>
Co-authored-by: rsommerfeld <romeo.sommerfeld@web.de>
Co-authored-by: Romeo Sommerfeld <55324905+rsommerfeld@users.noreply.github.com>
Co-authored-by: Jannis Berndt <berndtjannis@gmail.com>
Co-authored-by: PaulPanter <paul.ermler@web.de>
  • Loading branch information
8 people authored Jun 16, 2021
1 parent 0c5f139 commit 2bdb35e
Show file tree
Hide file tree
Showing 219 changed files with 840 additions and 319 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Please, go through these steps before you submit a PR.
c. You have only one commit (if not, squash them into one commit).

d. Running tests doesn't throw any error. If it does, fix them first and amend your commit (`git commit --amend`).

e. You have tracked ALL applicable time working in clockify!

3. **After** these steps, you're ready to open a pull request.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-linter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI-Lint

on:
on:
push:
branches:
- develop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on:
on:
push:
branches:
- develop
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_prefix.outputs.value }}${{ steps.current-time.outputs.formattedTime }}
tag_name: ${{ steps.tag_prefix.outputs.value }}${{ steps.current-time.outputs.formattedTime }}
release_name: ${{ matrix.smalltalk }} ${{ steps.current-time.outputs.formattedTime }}
draft: false
prerelease: ${{ env.prerelease }}
- name: Upload Release Asset
id: upload-release-asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: /home/runner/.smalltalkCI/_builds/TelegramClient.sar
asset_name: TelegramClient.sar
asset_content_type: application/zip
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $ git merge develop // merges changes from mast
When development on the feature is complete, reviewers should merge changes into `develop` and then make sure the remote branch is deleted.

```
$ git checkout develop // change to the develop branch
$ git checkout develop // change to the develop branch
$ git merge --no-ff feature/GH-id // makes sure to create a commit object during merge
$ git push origin develop // push merge changes
$ git push origin :feature/GH-id // deletes the remote branch
Expand All @@ -97,7 +97,7 @@ Fix branches differ from feature branches only semantically. Fix branches will b

Although likelihood will be less, during the lifespan of the bug development, the lead should watch the `develop` branch (network tool or branch tool in GitHub) to see if there have been commits since the bug was branched. Any and all changes to `develop` should be merged into the bug before merging back to `develop`; this can be done at various times during the project or at the end, but time to handle merge conflicts should be accounted for.

`<tbd number>` represents the Basecamp project to which Project Management will be tracked.
`<tbd number>` represents the Basecamp project to which Project Management will be tracked.

* Must branch from: `develop`
* Must merge back into: `develop`
Expand All @@ -121,7 +121,7 @@ $ git merge develop // merges changes from deve
When development on the bug is complete, [the Lead] should merge changes into `develop` and then make sure the remote branch is deleted.

```
$ git checkout develop // change to the develop branch
$ git checkout develop // change to the develop branch
$ git merge --no-ff bugfix/GH-id // makes sure to create a commit object during merge
$ git push origin develop // push merge changes
$ git push origin :bugfix/GH-id // deletes the remote branch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defines prequisites
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
baseline
baseline: spec
<baseline>

spec for: #common do: [
spec
baseline: 'Animations' with: [
Expand All @@ -21,7 +21,7 @@ baseline: spec
spec repository: 'github://hpi-swa-teaching/Morphic-Testing-Framework:master/packages'];
baseline: 'SwaLint' with: [
spec repository: 'github://hpi-swa-teaching/SwaLint:develop/packages'].

spec
package: 'TelegramClient-Core' with: [
spec requires: #('libraries')];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baseline
postLoad
(((Smalltalk respondsTo: #globals)
(((Smalltalk respondsTo: #globals)
ifTrue: [Smalltalk globals] "Squeak >=4.1"
ifFalse: [Smalltalk]) "Pharo and squeak <=4.0"
at: #SwaLint) perform: #install.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "per 6/15/2021 09:40",
"instvars" : [
],
"name" : "BaselineOfTelegramClient",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A TCCBasicGroupChat represents a Telegram BasicGroup with up to 200 members
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialization
initializeFromChatEvent: anEvent

super initializeFromChatEvent: anEvent.
self groupId: (((anEvent at: 'chat') at: 'type') at: 'basic_group_id')
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
isBasicGroup

^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
loading
loadInfo

self core client send: (TCCRequest
newWithType: 'getBasicGroupFullInfo'
from: {
'basic_group_id'->self groupId.
'@extra'->self groupId}).
self core registerCallback: [:aBasicGroupFullInfoEvent |
self
memberCount: (aBasicGroupFullInfoEvent at: 'members') size;
description: (aBasicGroupFullInfoEvent at: 'description').
self addMembersFrom: (aBasicGroupFullInfoEvent at: 'members').
] with: self groupId asString
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"class" : {
},
"instance" : {
"initializeFromChatEvent:" : "per 6/4/2021 15:06",
"isBasicGroup" : "per 6/15/2021 08:41",
"loadInfo" : "per 6/15/2021 08:36" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "TelegramClient-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "per 6/4/2021 14:36",
"instvars" : [
],
"name" : "TCCBasicGroupChat",
"pools" : [
],
"super" : "TCCGroupChat",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
instance creation
newFromChatEvent: anEvent

| type |
| type chat |
type := ((anEvent at: 'chat') at: 'type') at: '@type'.

^ (((type = 'chatTypeSupergroup') or: (type = 'chatTypeBasicGroup'))
ifTrue: [TCCGroup new]
ifFalse: [self new])
initializeFromChatEvent: anEvent;
yourself
type caseOf: {
['chatTypeSupergroup']->[chat := TCCSuperGroupChat new].
['chatTypeBasicGroup']->[chat := TCCBasicGroupChat new].
['chatTypePrivate']->[chat := TCCPrivateChat new].
}.

^ chat
initializeFromChatEvent: anEvent;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
core: aCore

core := aCore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
core

^ core
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
infoLoaded: aBoolean

infoLoaded := aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
infoLoaded

^ infoLoaded
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ initialize
messages: (OrderedCollection newFrom: {TCCNullMessage new});
waitingForUpdate: false;
positionKnown: false;
numberOfRequestedMessages: self class defaultNumberOfRequestedMessages.
infoLoaded: false;
numberOfRequestedMessages: self class defaultNumberOfRequestedMessages.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
isBasicGroup

^ false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
isGroup

^ false
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
isPrivate

^ (self type = 'chatTypePrivate')
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
isSuperGroup

^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
loadInfo

self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
loadInfoIfNotLoaded

self infoLoaded ifFalse: [
self loadInfo.
self infoLoaded: true.
]
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
{
"class" : {
"defaultNumberOfRequestedMessages" : "js 8/1/2020 18:52",
"newFromChatEvent:" : "JB 5/31/2021 16:21" },
"newFromChatEvent:" : "TR 6/15/2021 16:51" },
"instance" : {
"addNewestMessage:" : "js 8/2/2020 12:58",
"addOldestMessage:" : "js 8/2/2020 12:58",
"canSendMessages" : "5/11/2021 10:09:15",
"canSendMessages:" : "TR 5/5/2021 16:31",
"core" : "per 6/4/2021 16:00",
"core:" : "per 6/4/2021 15:58",
"id" : "rs 6/7/2020 22:20",
"id:" : "5/11/2021 10:09:15",
"ifNotWaitingForUpdate:" : "js 8/2/2020 13:17",
"initialize" : "JB 6/11/2021 18:31",
"initializeFromChatEvent:" : "JB 5/31/2021 16:19",
"isGroup" : "RS 5/29/2021 18:12",
"isPrivate" : "per 5/13/2021 08:48",
"infoLoaded" : "per 6/4/2021 15:59",
"infoLoaded:" : "per 6/4/2021 15:51",
"initialize" : "per 6/4/2021 15:49",
"initializeFromChatEvent:" : "RS 5/29/2021 17:23",
"isBasicGroup" : "per 6/15/2021 08:08",
"isGroup" : "per 6/4/2021 14:42",
"isPrivate" : "per 6/4/2021 14:42",
"isSuperGroup" : "per 6/15/2021 08:09",
"lastMessage" : "rs 6/19/2020 17:33",
"lastMessage:" : "5/11/2021 10:09:15",
"loadInfo" : "per 6/15/2021 09:49",
"loadInfoIfNotLoaded" : "TR 6/13/2021 15:54",
"messages" : "R.S 6/1/2020 15:37",
"messages:" : "5/11/2021 10:09:15",
"numberOfMessages" : "js 8/1/2020 18:04",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"waitingForUpdate",
"numberOfRequestedMessages",
"type",
"canSendMessages" ],
"canSendMessages",
"core",
"infoLoaded" ],
"name" : "TCCChat",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
events
addChat: aChatEvent

| chat |
chat := TCCChat newFromChatEvent: aChatEvent.
(chat type = 'chatTypeSupergroup') ifTrue: [
self loadSuperGroupInfoFor: chat with: (((aChatEvent at: 'chat') at: 'type') at: 'supergroup_id').
].
(chat type = 'chatTypeBasicGroup') ifTrue: [
self loadBasicGroupInfoFor: chat with: (((aChatEvent at: 'chat') at: 'type') at: 'basic_group_id').
].
chat core: self core.

self core chats
add: chat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library calls
getChatHistoryFrom: aChatID with: aMessageId limit: aLimit

| chat |

chat := self core chats getChat: aChatID.
chat ifNotWaitingForUpdate: [
self client send: (TCCRequest
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updateLastMessage: anEvent
(anEvent includesKey: 'last_message') ifTrue: [
content := (anEvent at: 'last_message') at: 'content'.
chat := self core chats getChat: (anEvent at: 'chat_id').

(anEvent at: 'positions') notEmpty
ifTrue: [chat position:
(((anEvent at: 'positions')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"class" : {
"defaultMessageLimit" : "js 8/1/2020 18:24" },
"defaultMessageLimit" : "per 6/4/2021 15:30" },
"instance" : {
"addChat:" : "JB 6/4/2021 21:34",
"addNewMessage:" : "pk 6/8/2021 09:31",
"chatHistoryReceived:" : "JB 6/13/2021 10:59",
"client" : "per 5/21/2021 16:55",
"core" : "per 5/21/2021 16:55",
"core:" : "per 5/21/2021 16:55",
"getChatHistoryFrom:with:limit:" : "per 5/21/2021 16:55",
"addChat:" : "per 6/15/2021 08:31",
"addNewMessage:" : "6/13/2021 15:37:32",
"chatHistoryReceived:" : "pk 5/12/2021 12:35",
"client" : "js 6/1/2020 14:44",
"core" : "6/4/2021 16:24:10",
"core:" : "6/4/2021 16:24:10",
"getChatHistoryFrom:with:limit:" : "js 8/2/2020 13:17",
"getChats" : "js 7/31/2020 22:50",
"handleNewMessage:" : "pk 6/8/2021 09:32",
"loadBasicGroupInfoFor:with:" : "TR 6/2/2021 13:59",
"loadSuperGroupInfoFor:with:" : "TR 6/2/2021 13:58",
"openNewChat:" : "pk 5/13/2021 12:45",
"remainingMessages" : "5/11/2021 10:09:15",
"remainingMessages:" : "js 8/1/2020 16:50",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
as yet unclassified
instance creation
newWithTeleClient: aTeleClient

^ self basicNew
Expand Down
Loading

0 comments on commit 2bdb35e

Please sign in to comment.