Skip to content

Status feature - #2505

Merged
camilasan merged 4 commits into
masterfrom
status-feature
Mar 24, 2021
Merged

camilasan merged 4 commits into
masterfrom
status-feature

Conversation

@camilasan

@camilasan camilasan commented Oct 3, 2020 •

Copy link
Copy Markdown
Member

Fix part of #2318:

  • Basic implementation, view-only: Show the status in the subline of the currently selected account in the header (instead of the cloud domain). The status indicator icon could just show as first element of the subline instead of messing with the sync overlay icon.

Do not disturb:
donotdisturb

Online:
online

Online with no message:
online-no-message

Away:
away

Invisible:
invisible

Offline (no status set):
offline

  • Icon placement: In the desktop client we already place the sync state icon over the avatar – unfortunately this conflicts with the status icon now. The end goal should be to have this consistent and have the icon overlaying the avatar being the status icon – so we need to change it in desktop. We could move the sync icon onto the folder icon in the header of the currently active account?

Connected:
connected

Disconnected:
disconnected

  • Do not disturb: If the status is set to "Do not disturb", do not send operating system notifications
  • Write tests

@camilasan
camilasan marked this pull request as draft October 3, 2020 15:19

@er-vin er-vin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Obviously" UserStatus looks like a good target for tests. Needs stubbing the server part somehow, I think we got something which might help there. We got that unused mockserver thing... maybe needs to be revived a bit.

Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.h Outdated
Comment thread src/gui/userstatus.h Outdated
Comment thread src/gui/userstatus.h Outdated
Comment thread src/gui/accountstate.cpp
Comment thread src/gui/accountstate.cpp Outdated
Comment thread test/testremotewipe.cpp Outdated
Comment thread src/gui/tray/Window.qml Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/accountstate.h
Comment thread src/gui/userstatus.h Outdated
Comment thread src/gui/accountstate.h
Comment thread src/gui/tray/UserLine.qml Outdated
Comment thread src/gui/tray/Window.qml Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp
@jancborchardt

Copy link
Copy Markdown
Member

@camilasan feel free to post screenshots if you need more design feedback. :)

@camilasan
camilasan force-pushed the status-feature branch 3 times, most recently from 4b8cd69 to a89f27f Compare March 17, 2021 22:20
@camilasan
camilasan marked this pull request as ready for review March 17, 2021 22:49
Comment thread src/gui/accountstate.cpp
Comment thread src/gui/tray/UserModel.cpp Outdated
Comment thread src/gui/tray/UserModel.cpp Outdated
Comment thread src/gui/tray/UserModel.cpp
Comment thread src/gui/tray/UserModel.cpp
Comment thread src/libsync/theme.h
Comment thread src/libsync/theme.h
Comment thread src/libsync/theme.h
Comment thread src/libsync/theme.h
Comment thread src/libsync/theme.h
Comment thread src/gui/tray/NotificationHandler.cpp Outdated
Comment thread src/gui/tray/NotificationHandler.h Outdated
Comment thread src/gui/tray/UserLine.qml
Comment thread src/gui/tray/UserModel.cpp Outdated
Comment thread src/gui/tray/Window.qml
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/accountstate.cpp
@camilasan
camilasan force-pushed the status-feature branch 3 times, most recently from 684a574 to 934d6a7 Compare March 18, 2021 15:22
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp Outdated
@allexzander

Copy link
Copy Markdown
Contributor

@camilasan Any chance you can fix those clang-tidy errors?

Comment thread src/gui/accountstate.cpp Outdated
Comment thread src/gui/accountstate.cpp Outdated
Comment thread src/gui/accountstate.h Outdated
Comment thread src/gui/accountstate.h Outdated
Comment thread src/gui/accountstate.h Outdated
Comment thread src/gui/tray/UserModel.h Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/userstatus.cpp
Comment thread src/gui/userstatus.h Outdated
Comment thread src/libsync/theme.h Outdated
@camilasan
camilasan force-pushed the status-feature branch 2 times, most recently from aa920ef to 0b4b8e0 Compare March 19, 2021 18:16
Comment thread src/gui/accountstate.cpp Outdated
Comment thread src/gui/userstatus.cpp Outdated
Comment thread src/gui/accountstate.cpp
Comment thread src/gui/tray/UserModel.h Outdated
@camilasan
camilasan force-pushed the status-feature branch 2 times, most recently from 4344b41 to 6134e2b Compare March 23, 2021 07:49
Comment thread src/gui/accountstate.h
Comment thread src/gui/userstatus.h
Comment thread src/gui/userstatus.cpp
Comment thread src/gui/tray/NotificationHandler.h Outdated
Comment thread src/gui/accountstate.cpp
@allexzander

Copy link
Copy Markdown
Contributor

@camilasan I guess, those clang-tidy issues need to be addressed too :)

@allexzander

Copy link
Copy Markdown
Contributor

@camilasan @er-vin @FlexW Maybe we should add tests after this PR is merged?

@camilasan
camilasan force-pushed the status-feature branch 2 times, most recently from 7b73840 to 34ff16d Compare March 24, 2021 14:23
Camila added 4 commits March 24, 2021 15:39
- AccountState controls UserStatus.
- Display user status in the system tray menu next to user's avatar.

Signed-off-by: Camila <[email protected]>
- This information is retrieved from the notifications endpoint.
- Add icons for the different pre defined status.
- Make functions available to QML to decide which status icon to display.
- Display the user status icon on the avatar and
move the online/offline connection status to the folder icon.

Signed-off-by: Camila <[email protected]>
- User QHash to map status strings and Status enum.

Signed-off-by: Camila <[email protected]>
@nextcloud-desktop-bot

Copy link
Copy Markdown

AppImage file: Nextcloud-PR-2505-9219926a74b954b5915f2a9e4e3900604aca577b-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@camilasan
camilasan merged commit e8669ad into master Mar 24, 2021
@camilasan
camilasan deleted the status-feature branch March 24, 2021 16:28
Comment thread src/gui/accountstate.h
Comment thread src/gui/tray/NotificationHandler.h
Comment thread src/gui/tray/UserModel.cpp
}

void User::slotRefreshUserStatus() {
// TODO: check for _account->account()->capabilities().userStatus()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, asks for a followup PR

Comment thread src/gui/tray/UserModel.cpp
Comment thread src/gui/userstatus.cpp
Comment thread src/gui/userstatus.h
Comment thread src/gui/userstatus.h
Comment thread src/gui/userstatus.h
Comment thread src/libsync/networkjobs.h
* @brief desktopNotificationStatusReceived - signal to report if notifications are allowed
* @param status - set desktop notifications allowed status
*/
void allowDesktopNotificationsChanged(const bool isAllowed);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This strikes me as strange design wise that this sits on the very general JsonApiJob... I'd have expected the corresponding header to be checked in UserStatus (IIRC you should have access to the reply there).

@er-vin

er-vin commented Mar 25, 2021 via email

Copy link
Copy Markdown
Member

@camilasan camilasan mentioned this pull request Apr 6, 2021
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants