Search in sources :

Example 1 with ChatParticipant

use of com.azure.android.communication.chat.implementation.models.ChatParticipant in project azure-sdk-for-android by Azure.

the class ChatImplClientTestBase method createThreadOptions.

protected static CreateChatThreadOptions createThreadOptions(String userId1, String userId2) {
    List<ChatParticipant> participants = new ArrayList<ChatParticipant>();
    participants.add(generateParticipant(userId1, "Tester 1"));
    participants.add(generateParticipant(userId2, "Tester 2"));
    CreateChatThreadOptions options = new CreateChatThreadOptions().setTopic("Test").setParticipants(participants);
    return options;
}
Also used : ArrayList(java.util.ArrayList) ChatParticipant(com.azure.android.communication.chat.implementation.models.ChatParticipant) CreateChatThreadOptions(com.azure.android.communication.chat.implementation.models.CreateChatThreadOptions)

Example 2 with ChatParticipant

use of com.azure.android.communication.chat.implementation.models.ChatParticipant in project azure-sdk-for-android by Azure.

the class ChatMessageContentConverter method convert.

/**
 * Maps from {com.azure.android.communication.chat.implementation.models.ChatMessageContent} to {@link ChatMessageContent}.
 */
public static ChatMessageContent convert(com.azure.android.communication.chat.implementation.models.ChatMessageContent obj, ClientLogger logger) {
    if (obj == null) {
        return null;
    }
    ChatMessageContent chatMessageContent = new ChatMessageContent().setMessage(obj.getMessage()).setTopic(obj.getTopic());
    if (obj.getInitiatorCommunicationIdentifier() != null) {
        chatMessageContent.setInitiatorCommunicationIdentifier(CommunicationIdentifierConverter.convert(obj.getInitiatorCommunicationIdentifier(), logger));
    }
    if (obj.getParticipants() != null) {
        List<com.azure.android.communication.chat.models.ChatParticipant> participants = new ArrayList<>(obj.getParticipants().size());
        for (ChatParticipant innerParticipant : obj.getParticipants()) {
            participants.add(ChatParticipantConverter.convert(innerParticipant, logger));
        }
        chatMessageContent.setParticipants(participants);
    }
    return chatMessageContent;
}
Also used : ArrayList(java.util.ArrayList) ChatParticipant(com.azure.android.communication.chat.implementation.models.ChatParticipant) ChatMessageContent(com.azure.android.communication.chat.models.ChatMessageContent)

Example 3 with ChatParticipant

use of com.azure.android.communication.chat.implementation.models.ChatParticipant in project azure-sdk-for-android by Azure.

the class ChatImplClientTestBase method generateParticipant.

private static ChatParticipant generateParticipant(String id, String displayName) {
    ChatParticipant chatParticipant = new ChatParticipant();
    chatParticipant.setCommunicationIdentifier(new CommunicationIdentifierModel().setCommunicationUser(new CommunicationUserIdentifierModel().setId(id)));
    chatParticipant.setDisplayName(displayName);
    return chatParticipant;
}
Also used : CommunicationUserIdentifierModel(com.azure.android.communication.chat.implementation.models.CommunicationUserIdentifierModel) ChatParticipant(com.azure.android.communication.chat.implementation.models.ChatParticipant) CommunicationIdentifierModel(com.azure.android.communication.chat.implementation.models.CommunicationIdentifierModel)

Aggregations

ChatParticipant (com.azure.android.communication.chat.implementation.models.ChatParticipant)3 ArrayList (java.util.ArrayList)2 CommunicationIdentifierModel (com.azure.android.communication.chat.implementation.models.CommunicationIdentifierModel)1 CommunicationUserIdentifierModel (com.azure.android.communication.chat.implementation.models.CommunicationUserIdentifierModel)1 CreateChatThreadOptions (com.azure.android.communication.chat.implementation.models.CreateChatThreadOptions)1 ChatMessageContent (com.azure.android.communication.chat.models.ChatMessageContent)1