diff --git a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt index 921cf27a7f..d4033d7fa6 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/assignmentDetails/AssignmentDetailsPresenter.kt @@ -18,9 +18,7 @@ package com.instructure.student.mobius.assignmentDetails import android.content.Context import androidx.core.content.ContextCompat -import com.instructure.canvasapi2.models.Assignment -import com.instructure.canvasapi2.models.DiscussionTopicHeader -import com.instructure.canvasapi2.models.Quiz +import com.instructure.canvasapi2.models.* import com.instructure.canvasapi2.utils.DateHelper import com.instructure.canvasapi2.utils.NumberHelper import com.instructure.canvasapi2.utils.isRtl @@ -37,6 +35,8 @@ import com.instructure.student.mobius.assignmentDetails.ui.gradeCell.GradeCellVi import com.instructure.student.mobius.common.ui.Presenter import java.text.DateFormat import java.util.* +import kotlin.contracts.ExperimentalContracts +import kotlin.contracts.contract object AssignmentDetailsPresenter : Presenter { override fun present(model: AssignmentDetailsModel, context: Context): AssignmentDetailsViewState { @@ -290,13 +290,17 @@ object AssignmentDetailsPresenter : PresenterReply Edit Replies are only visible to those who have posted at least one reply. - Unknown Author Delete Discussion Delete Discussion? This will delete the whole discussion and thread. diff --git a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/DiscussionParticipant.kt b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/DiscussionParticipant.kt index 15d385153a..3a63900b2a 100644 --- a/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/DiscussionParticipant.kt +++ b/libs/canvas-api-2/src/main/java/com/instructure/canvasapi2/models/DiscussionParticipant.kt @@ -29,4 +29,9 @@ data class DiscussionParticipant( var avatarImageUrl: String? = null, @SerializedName("html_url") var htmlUrl: String? = null -) : CanvasModel() \ No newline at end of file +) : CanvasModel() + +fun DiscussionParticipant?.isDiscussionAuthorNull(): Boolean { + return this == null || + (id == 0L && displayName == null && avatarImageUrl == null && htmlUrl == null) +} \ No newline at end of file diff --git a/libs/pandares/src/main/res/values/strings.xml b/libs/pandares/src/main/res/values/strings.xml index e1e8113122..c8992f85d9 100644 --- a/libs/pandares/src/main/res/values/strings.xml +++ b/libs/pandares/src/main/res/values/strings.xml @@ -1119,6 +1119,8 @@ View Discussion This assignment is locked by the module \"%1$s\". Choose Media File + Unknown Author + Unknown Date %s. minus %s. %s %s