Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CM-1954] Dynamic online/offline status #402

Merged
merged 4 commits into from
Mar 11, 2024
Merged

[CM-1954] Dynamic online/offline status #402

merged 4 commits into from
Mar 11, 2024

Conversation

AbhijeetRanjan308
Copy link
Contributor

@AbhijeetRanjan308 AbhijeetRanjan308 commented Mar 5, 2024

Summary

  • Created a function to update the Assignee Status.
Kommunicate.updateAssigneeStatus(status: .online)
  • Added a Support to update only for particular assignee.
Kommunicate.updateAssigneeStatus(assigneeID: "abhijeet_agent",status: .away)

@AbhijeetRanjan308 AbhijeetRanjan308 changed the title [CM-1954] Added the Function to update the assignee status. [CM-1954] Dynamic online/offline status Mar 6, 2024

weak var delegate: KMUpdateAssigneeStatusDelegate?

public var channelID: Int?
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add assignee id as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

/// - channelID: The Channel ID parameter is required to match the conversation in which the status needs to be updated. If the Channel ID is not provided, the status will be updated in all conversations.
/// - status: A predefined status among 'Online', 'Offline', 'Away', and 'Default'. The 'Default' status corresponds to the assignee status fetched from MQTT.
open class func updateAssigneeStatus(channelID: Int = 0, status: KMUserStatus) {
KMUpdateAssigneeStatus.shared.channelID = channelID
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we wrap it in single call ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed the channelID with assigneeID

@@ -362,7 +374,35 @@ open class KMConversationViewController: ALKConversationViewController {
self.assigneeUserId = contact?.userId
self.hideInputBarIfAssignedToBot()
guard let contact = contact else {return}
self.isAwayMessageViewHidden = !contact.isInAwayMode
guard let assigneeUserId = self.assigneeUserId, ( assigneeUserId == KMUpdateAssigneeStatus.shared.assigneeID || KMUpdateAssigneeStatus.shared.assigneeID == "") else {
Copy link
Contributor

Choose a reason for hiding this comment

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

use empty check here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added the Check

@kandpal025 kandpal025 merged commit d68ffcf into dev Mar 11, 2024
0 of 4 checks passed
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.

3 participants