#define OCS_SUCCESS_STATUS_CODE 100
// Apparantly the v2.php URLs can return that
#define OCS_SUCCESS_STATUS_CODE_V2 200
+// Two factor auth notification returns Accepted 202
+#define OCS_ACCEPTED_STATUS_CODE 202
// not modified when using ETag
#define OCS_NOT_MODIFIED_STATUS_CODE_V2 304
property string text: ""
property string toolTipText: ""
- property bool bold: false
+ property bool primaryButton: false
property string imageSource: ""
property string imageSourceHover: ""
property color textColor: Style.ncTextColor
property color textColorHovered: Style.ncSecondaryTextColor
- property bool primaryButton: false
-
signal clicked()
Loader {
- active: root.imageSource === "" && !primaryButton
+ active: !root.primaryButton
anchors.fill: parent
}
Loader {
- active: root.imageSource !== "" || primaryButton
+ active: root.primaryButton
anchors.fill: parent
textColor: root.textColor
textColorHovered: root.textColorHovered
- bold: root.bold
+ bold: root.primaryButton
imageSource: root.imageSource
imageSourceHover: root.imageSourceHover
imageSource: model.modelData.imageSource ? model.modelData.imageSource + root.adjustedHeaderColor : ""
imageSourceHover: model.modelData.imageSourceHovered ? model.modelData.imageSourceHovered + UserModel.currentUser.headerTextColor : ""
- textColor: imageSource !== "" || primary ? root.adjustedHeaderColor : Style.ncTextColor
- textColorHovered: imageSource !== "" || primary ? UserModel.currentUser.headerTextColor : Style.ncTextColor
+ textColor: primary ? root.adjustedHeaderColor : Style.ncTextColor
+ textColorHovered: primary ? UserModel.currentUser.headerTextColor : Style.ncTextColor
- bold: primary
primaryButton: primary
onClicked: !isTalkReplyButton ? root.triggerAction(model.index) : root.showReplyField()
{
int row = sender()->property("activityRow").toInt();
- // the ocs API returns stat code 100 or 200 inside the xml if it succeeded.
- if (statusCode != OCS_SUCCESS_STATUS_CODE && statusCode != OCS_SUCCESS_STATUS_CODE_V2) {
+ // the ocs API returns stat code 100 or 200 or 202 inside the xml if it succeeded.
+ if (statusCode != OCS_SUCCESS_STATUS_CODE
+ && statusCode != OCS_SUCCESS_STATUS_CODE_V2
+ && statusCode != OCS_ACCEPTED_STATUS_CODE) {
qCWarning(lcActivity) << "Notification Request to Server failed, leave notification visible.";
} else {
// to do use the model to rebuild the list or remove the item