mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 08:15:04 +01:00
add poll system message, klint fixes
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
9f90e9c4c6
commit
8148bfaa65
app/src/main/java/com/nextcloud/talk
models/json
polls
@ -490,7 +490,8 @@ data class ChatMessage(
|
|||||||
CLEARED_CHAT,
|
CLEARED_CHAT,
|
||||||
REACTION,
|
REACTION,
|
||||||
REACTION_DELETED,
|
REACTION_DELETED,
|
||||||
REACTION_REVOKED
|
REACTION_REVOKED,
|
||||||
|
POLL_VOTED
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -65,6 +65,7 @@ import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.MODERAT
|
|||||||
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.OBJECT_SHARED
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.OBJECT_SHARED
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.PASSWORD_REMOVED
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.PASSWORD_REMOVED
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.PASSWORD_SET
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.PASSWORD_SET
|
||||||
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.POLL_VOTED
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.REACTION
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.REACTION
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.REACTION_DELETED
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.REACTION_DELETED
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.REACTION_REVOKED
|
import com.nextcloud.talk.models.json.chat.ChatMessage.SystemMessageType.REACTION_REVOKED
|
||||||
@ -167,6 +168,7 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
|
|||||||
"reaction" -> REACTION
|
"reaction" -> REACTION
|
||||||
"reaction_deleted" -> REACTION_DELETED
|
"reaction_deleted" -> REACTION_DELETED
|
||||||
"reaction_revoked" -> REACTION_REVOKED
|
"reaction_revoked" -> REACTION_REVOKED
|
||||||
|
"poll_voted" -> POLL_VOTED
|
||||||
else -> DUMMY
|
else -> DUMMY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,6 +226,7 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
|
|||||||
REACTION -> return "reaction"
|
REACTION -> return "reaction"
|
||||||
REACTION_DELETED -> return "reaction_deleted"
|
REACTION_DELETED -> return "reaction_deleted"
|
||||||
REACTION_REVOKED -> return "reaction_revoked"
|
REACTION_REVOKED -> return "reaction_revoked"
|
||||||
|
POLL_VOTED -> return "poll_voted"
|
||||||
else -> return ""
|
else -> return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,13 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
|
|||||||
)
|
)
|
||||||
|
|
||||||
override fun createPoll(
|
override fun createPoll(
|
||||||
roomToken: String, question: String, options: List<String>, resultMode: Int, maxVotes:
|
roomToken: String,
|
||||||
|
question: String,
|
||||||
|
options: List<String>,
|
||||||
|
resultMode: Int,
|
||||||
|
maxVotes:
|
||||||
Int
|
Int
|
||||||
):
|
): Observable<Poll>? {
|
||||||
Observable<Poll>? {
|
|
||||||
return ncApi.createPoll(
|
return ncApi.createPoll(
|
||||||
credentials,
|
credentials,
|
||||||
ApiUtils.getUrlForPoll(
|
ApiUtils.getUrlForPoll(
|
||||||
|
@ -94,7 +94,6 @@ class PollResultsFragment(
|
|||||||
) {
|
) {
|
||||||
Log.d(TAG, "show results also if self never voted")
|
Log.d(TAG, "show results also if self never voted")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user