talk-android
talk-android copied to clipboard
Show a temporary messages when sending and keep it on error
| Success (bonus weird scrolling) | Error case (with copy/paste option) |
|---|---|
![]() |
![]() |
I have no clue why the scrolling freaks out like this.
Code changes to help testing
Modify your Talk install to make the response slower:
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index f8e0f19a6..e71bd1d81 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -226,6 +226,7 @@ class ChatController extends AEnvironmentAwareController {
* found".
*/
public function sendMessage(string $message, string $actorDisplayName = '', string $referenceId = '', int $replyTo = 0): DataResponse {
+ sleep(1);
[$actorType, $actorId] = $this->getActorInfo($actorDisplayName);
if (!$actorId) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
And use the follow change to create a slow error
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index f8e0f19a6..e71bd1d81 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -226,6 +226,8 @@ class ChatController extends AEnvironmentAwareController {
* found".
*/
public function sendMessage(string $message, string $actorDisplayName = '', string $referenceId = '', int $replyTo = 0): DataResponse {
+ sleep(1);
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
[$actorType, $actorId] = $this->getActorInfo($actorDisplayName);
if (!$actorId) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
Follow up todos
- [ ] Fix scrolling (I have no idea where it goes wild)
- [ ] Messages can have a reference id which should be set and the temporary messages only be removed by the fetching of messages when there is a reference id match.
Fix #838
wow that's on old one. i now rebased on master but didn't have a closer look what needs to be done here
Lint
| Type | master | PR |
| Warnings | 116 | 116 |
| Errors | 1 | 1 |
SpotBugs (new)
| Warning Type | Number |
|---|---|
| Bad practice Warnings | 8 |
| Correctness Warnings | 35 |
| Experimental Warnings | 2 |
| Internationalization Warnings | 9 |
| Malicious code vulnerability Warnings | 23 |
| Performance Warnings | 22 |
| Security Warnings | 2 |
| Dodgy code Warnings | 65 |
| Total | 166 |
SpotBugs (master)
| Warning Type | Number |
|---|---|
| Bad practice Warnings | 8 |
| Correctness Warnings | 35 |
| Experimental Warnings | 2 |
| Internationalization Warnings | 9 |
| Malicious code vulnerability Warnings | 23 |
| Performance Warnings | 22 |
| Security Warnings | 2 |
| Dodgy code Warnings | 65 |
| Total | 166 |
/rebase
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/1259-talk.apk
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.
/rebase
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/1259-talk.apk
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.
Codacy
Lint
| Type | master | PR |
| Warnings | 109 | 109 |
| Errors | 0 | 0 |
SpotBugs
| Category | Base | New |
|---|---|---|
| Correctness | 12 | 12 |
| Dodgy code | 173 | 173 |
| Internationalization | 5 | 5 |
| Malicious code vulnerability | 3 | 3 |
| Performance | 9 | 9 |
| Security | 2 | 2 |
| Total | 204 | 204 |
wow that's on old one. i now rebased on master but didn't have a closer look what needs to be done here
Any chance this makes it at some point? :)

