Search in sources :

Example 26 with Invitee

use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.

the class ChatTestIntegration method createThreadWithMetaData.

@Test
@MediumTest
public void createThreadWithMetaData() {
    sleep(7000);
    Invitee[] invite = new Invitee[] { new Invitee("589", 2), new Invitee("1162", 2), new Invitee("2404", 2) // , new Invitee(824, 2)
    };
    Contact contac = new Contact();
    contac.setLastName("mamadi");
// String  metaData =
// JsonUtil.getJson(contac);
// presenter.createThread(0,invite,null,null,null,metaData,null);
}
Also used : Invitee(com.fanap.podchat.mainmodel.Invitee) RequestSearchContact(com.fanap.podchat.mainmodel.RequestSearchContact) Contact(com.fanap.podchat.mainmodel.Contact) FlakyTest(android.support.test.filters.FlakyTest) MediumTest(android.support.test.filters.MediumTest) Test(org.junit.Test) LargeTest(android.support.test.filters.LargeTest) MediumTest(android.support.test.filters.MediumTest)

Example 27 with Invitee

use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.

the class ChatTestIntegration method registerAssistant.

private void registerAssistant() {
    // 63253 kheirkhah
    // 63254 sajadi
    // //63255 anvari
    // 63256 amjadi
    // 63257 zhiani
    // invite list
    // 52987   khodam
    // 103187  nemati
    Invitee invite = new Invitee("63253", InviteType.Constants.TO_BE_USER_CONTACT_ID);
    // roles
    ArrayList<String> typeRoles = new ArrayList<>();
    typeRoles.add(RoleType.Constants.READ_THREAD);
    typeRoles.add(RoleType.Constants.EDIT_THREAD);
    typeRoles.add(RoleType.Constants.ADD_ROLE_TO_USER);
    List<AssistantVo> assistantVos = new ArrayList<>();
    AssistantVo assistantVo = new AssistantVo();
    assistantVo.setInvitees(invite);
    assistantVo.setContactType("default");
    assistantVo.setRoles(typeRoles);
    assistantVos.add(assistantVo);
    RegisterAssistantRequest request = new RegisterAssistantRequest.Builder(assistantVos).build();
    presenter.registerAssistant(request);
    pauseProcess();
}
Also used : Invitee(com.fanap.podchat.mainmodel.Invitee) AssistantVo(com.fanap.podchat.chat.assistant.model.AssistantVo) ArrayList(java.util.ArrayList) RegisterAssistantRequest(com.fanap.podchat.chat.assistant.request_model.RegisterAssistantRequest)

Example 28 with Invitee

use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method createThread.

private void createThread() {
    /**
     * int TO_BE_USER_SSO_ID = 1;
     * int TO_BE_USER_CONTACT_ID = 2;
     * int TO_BE_USER_CELLPHONE_NUMBER = 3;
     * int TO_BE_USER_USERNAME = 4;
     * int TO_BE_USER_ID = 5; // just for p2p
     */
    /**
     *"create thread"
     * This is Invitee object
     * ---->private int id;
     * ---->private int idType;
     *
     * createThreadTypes = {
     *NORMAL: 0,
     *OWNER_GROUP: 1,
     *PUBLIC_GROUP: 2,
     *CHANNEL_GROUP: 4,
     *CHANNEL: 8
     *       }
     */
    // Invitee[] invite = new Invitee[]{
    // new Invitee(2951, 2)
    // , new Invitee(1967, 2)
    // ,new Invitee(123, 5)
    // , new Invitee(824, 2)
    // };
    /**
     * CHANNEL_GROUP: 4,
     */
    // Invitee[] invite = new Invitee[]{
    // //       new Invitee(3361, 2)
    // //       , new Invitee(3102, 2)
    // //       new Invitee(091, 1),
    // //       new Invitee("22835", InviteType.Constants.TO_BE_USER_CONTACT_ID),
    // new Invitee("29782", InviteType.Constants.TO_BE_USER_CONTACT_ID),
    // //       new Invitee("27774", InviteType.Constants.TO_BE_USER_CONTACT_ID),
    // //       new Invitee("22835", InviteType.Constants.TO_BE_USER_CONTACT_ID),
    // //       new Invitee(5638, 2),
    // //       new Invitee("z.mohammadi", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("p.khoshghadam", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("m.hasanpour", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("z.ershad", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("samira.amiri", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("s.heydarizadeh", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("p.pahlavani", InviteType.Constants.TO_BE_USER_USERNAME),
    // //      new Invitee("ma.amjadi", InviteType.Constants.TO_BE_USER_USERNAME),
    // //       new Invitee(5638, 2),
    // };
    Inviter inviterw = new Inviter();
    inviterw.setName("this is sample metadata");
    String metac = gson.toJson(inviterw);
    List<Invitee> invite = new ArrayList<>();
    // add by user SSO_ID
    // invite.add(new Invitee(122, 1));  //user jiji
    // invite.add(new Invitee("121", 1)); // user zizi
    // invite.add(new Invitee("63270", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // invite.add(new Invitee("63271", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // integration users
    // invite.add(new Invitee("63256", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // invite.add(new Invitee("63255", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // invite.add(new Invitee("63253", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // sand box users
    // 52620 farhad
    // 52979 masoud
    // 52987 khodam
    // invite.add(new Invitee("52620", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    invite.add(new Invitee("63254", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // invite.add(new Invitee("52987", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // invite.add(new Invitee("1", InviteType.Constants.TO_BE_USER_ID)); //amjadi
    // invite.add(new Invitee("80618", InviteType.Constants.TO_BE_USER_CONTACT_ID));
    // invite.add(new Invitee(9981084527L, 3)); zizi cellphone
    // invite.add(new Invitee(123, 5)); //user fifi
    // invite.add(new Invitee(121, 5)); // user zizi
    // invite.add(new Invitee(122, 1));  //user jiji
    RequestUploadImage requestUploadImage = new RequestUploadImage.Builder(ChatActivity.this, getUri()).sethC(140).setwC(140).build();
    RequestCreateThread requestCreateThread = new RequestCreateThread.Builder(ThreadType.Constants.NORMAL, invite).title("Test Thread ByAhmad" + (new Date().getTime() / 1000)).build();
    presenter.createThread(requestCreateThread);
}
Also used : Invitee(com.fanap.podchat.mainmodel.Invitee) RequestUploadImage(com.fanap.podchat.requestobject.RequestUploadImage) Inviter(com.fanap.podchat.mainmodel.Inviter) GsonBuilder(com.google.gson.GsonBuilder) ArrayList(java.util.ArrayList) RequestCreateThread(com.fanap.podchat.requestobject.RequestCreateThread) Date(java.util.Date)

Example 29 with Invitee

use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method registerAssistant.

private void registerAssistant() {
    // 63263 kheirkhah
    // //63264 anvari
    // 63254 sajadi
    // 63256 amjadi
    // 63257 zhiani
    // invite list
    // 103187 nemati sandbox
    // 52987 sajadi 9063 sandbox
    Invitee invite = new Invitee("63256", InviteType.Constants.TO_BE_USER_CONTACT_ID);
    // roles
    ArrayList<String> typeRoles = new ArrayList<>();
    typeRoles.add(RoleType.Constants.REMOVE_ROLE_FROM_USER);
    List<AssistantVo> assistantVos = new ArrayList<>();
    AssistantVo assistantVo = new AssistantVo();
    assistantVo.setInvitees(invite);
    assistantVo.setContactType("default");
    assistantVo.setRoles(typeRoles);
    assistantVos.add(assistantVo);
    RegisterAssistantRequest request = new RegisterAssistantRequest.Builder(assistantVos).build();
    presenter.registerAssistant(request);
}
Also used : Invitee(com.fanap.podchat.mainmodel.Invitee) AssistantVo(com.fanap.podchat.chat.assistant.model.AssistantVo) ArrayList(java.util.ArrayList) RegisterAssistantRequest(com.fanap.podchat.chat.assistant.request_model.RegisterAssistantRequest)

Example 30 with Invitee

use of com.fanap.podchat.mainmodel.Invitee in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method createThreadWithMessage.

private void createThreadWithMessage() {
    List<Invitee> invite = new ArrayList<>();
    invite.add(new Invitee(1151568, InviteType.Constants.TO_BE_USER_CONTACT_ID));
    invite.add(new Invitee(1512305, InviteType.Constants.TO_BE_USER_CONTACT_ID));
    RequestUploadImage requestUploadThreadImageImage = new RequestUploadImage.Builder(ChatActivity.this, getUri()).setwC(140).sethC(140).build();
    RequestThreadInnerMessage message = new RequestThreadInnerMessage.Builder("Hi at " + new Date().toString(), TextMessageType.Constants.TEXT).build();
    RequestCreateThread requestCreateThread = new RequestCreateThread.Builder(ThreadType.Constants.OWNER_GROUP, invite).message(message).setUploadThreadImageRequest(requestUploadThreadImageImage).build();
    presenter.createThreadWithMessage(requestCreateThread);
}
Also used : Invitee(com.fanap.podchat.mainmodel.Invitee) RequestUploadImage(com.fanap.podchat.requestobject.RequestUploadImage) RequestThreadInnerMessage(com.fanap.podchat.mainmodel.RequestThreadInnerMessage) ArrayList(java.util.ArrayList) RequestCreateThread(com.fanap.podchat.requestobject.RequestCreateThread) Date(java.util.Date)

Aggregations

Invitee (com.fanap.podchat.mainmodel.Invitee)32 ArrayList (java.util.ArrayList)25 AssistantVo (com.fanap.podchat.chat.assistant.model.AssistantVo)13 Test (org.junit.Test)9 LargeTest (android.support.test.filters.LargeTest)8 RegisterAssistantRequest (com.fanap.podchat.chat.assistant.request_model.RegisterAssistantRequest)8 Contact (com.fanap.podchat.mainmodel.Contact)8 AcceptCallRequest (com.fanap.podchat.call.request_model.AcceptCallRequest)6 CallRequest (com.fanap.podchat.call.request_model.CallRequest)6 EndCallRequest (com.fanap.podchat.call.request_model.EndCallRequest)6 RejectCallRequest (com.fanap.podchat.call.request_model.RejectCallRequest)6 TerminateCallRequest (com.fanap.podchat.call.request_model.TerminateCallRequest)6 Date (java.util.Date)6 SuppressLint (android.annotation.SuppressLint)5 ChatListener (com.fanap.podchat.chat.ChatListener)5 BlockUnblockAssistantRequest (com.fanap.podchat.chat.assistant.request_model.BlockUnblockAssistantRequest)5 GsonBuilder (com.google.gson.GsonBuilder)5 ResultContact (com.fanap.podchat.model.ResultContact)4 RequestGetContact (com.fanap.podchat.requestobject.RequestGetContact)4 List (java.util.List)4