public String getServerSyncCallKey(Contact contact, Channel channel, Integer conversationId) { return SERVER_SYNC.replace("[CONVERSATION]", conversationId != null ? String.valueOf(conversationId) : "") .replace("[CONTACT]", contact != null ? contact.getContactIds() : "") .replace("[CHANNEL]", channel != null ? String.valueOf(channel.getKey()) : ""); }
public ChannelFeed(Channel group) { this.id = group.getKey(); this.name = group.getName(); }
@Override protected Long doInBackground(Void... params) { if (channel != null && !TextUtils.isEmpty(userId)) { apiResponse = channelService.addMemberToChannelWithResponseProcess(channel.getKey(), userId); } if (channel != null && TextUtils.isEmpty(userId)) { responseForDeleteGroup = channelService.processChannelDeleteConversation(channel, context); } return null; }
public synchronized String processChannelDeleteConversation(Channel channel, Context context) { String response = new MobiComConversationService(context).deleteSync(null, channel, null); if (!TextUtils.isEmpty(response) && "success".equals(response)) { channelDatabaseService.deleteChannelUserMappers(channel.getKey()); channelDatabaseService.deleteChannel(channel.getKey()); } return response; }
@Override protected void onPostExecute(Channel channel) { super.onPostExecute(channel); if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss(); } if (channel != null) { Intent intent = new Intent(context, ConversationActivity.class); intent.putExtra(ConversationUIService.GROUP_ID, channel.getKey()); intent.putExtra(ConversationUIService.GROUP_NAME, channel.getName()); startActivity(intent); } }
@Override protected Long doInBackground(Void... params) { if (channel != null && channelUserMapper != null) { responseForRemove = channelService.removeMemberFromChannelProcess(channel.getKey(), channelUserMapper.getUserKey()); } return null; }
public void updateChannel(Channel channel) { ContentValues contentValues = prepareChannelValues(channel); dbHelper.getWritableDatabase().update(CHANNEL, contentValues, MobiComDatabaseHelper.CHANNEL_KEY + "=?", new String[]{String.valueOf(channel.getKey())}); dbHelper.close(); }
public synchronized boolean isUserAlreadyPresentInChannel(String clientGroupId, String userId) { Channel channel = channelDatabaseService.getChannelByClientGroupId(clientGroupId); return channelDatabaseService.isChannelUserPresent(channel.getKey(), userId); }
public int removeMemberFromChannel(String clientGroupId, String userId) { Channel channel = getChannelByClientGroupId(clientGroupId); return removeMemberFromChannel(channel.getKey(), userId); }
public int leaveMemberFromChannel(String clientGroupId, String userId) { Channel channel = getChannelByClientGroupId(clientGroupId); return leaveMemberFromChannel(channel.getKey(), userId); }
public void updateChannel(Channel channel) { if (channelDatabaseService.getChannelByChannelKey(channel.getKey()) == null) { channelDatabaseService.addChannel(channel); } else { channelDatabaseService.updateChannel(channel); } }
public boolean isMessageForCurrentConversation(Message message) { return (message.getGroupId() != null && channel != null && message.getGroupId().equals(channel.getKey())) || (!TextUtils.isEmpty(message.getContactIds()) && contact != null && message.getContactIds().equals(contact.getContactIds())) && message.getGroupId() == null; }
public void typingStopped(Contact contact, Channel channel) { String currentId; if (channel != null) { currentId = String.valueOf(channel.getKey()); } else { currentId = contact.getUserId(); } MobiComUserPreference mobiComUserPreference = MobiComUserPreference.getInstance(context); publishTopic(getApplicationKey(context), "0", mobiComUserPreference.getUserId(), currentId); }
public void updateReadStatus(Contact contact, Channel channel) { String contactNumberParameter = ""; String response = ""; if (contact != null && !TextUtils.isEmpty(contact.getContactIds())) { contactNumberParameter = "?userId=" + contact.getContactIds(); } else if (channel != null) { contactNumberParameter = "?groupId=" + channel.getKey(); } response = httpRequestUtils.getResponse(getUpdateReadStatusUrl() + contactNumberParameter, "text/plain", "text/plain"); Utils.printLog(context, TAG, "Read status response is " + response); }
public void typingStarted(Contact contact, Channel channel) { String currentId; if (channel != null) { currentId = String.valueOf(channel.getKey()); } else { currentId = contact.getUserId(); } MobiComUserPreference mobiComUserPreference = MobiComUserPreference.getInstance(context); publishTopic(getApplicationKey(context), "1", mobiComUserPreference.getUserId(), currentId); }
public synchronized boolean processIsUserPresentInChannel(String clientGroupId) { Channel channel = channelDatabaseService.getChannelByClientGroupId(clientGroupId); return channelDatabaseService.isChannelUserPresent(channel.getKey(), MobiComUserPreference.getInstance(context).getUserId()); }
public GroupInfoUpdate(Channel channel) { this.newName = channel.getName(); this.groupId = channel.getKey(); this.clientGroupId = channel.getClientGroupId(); this.imageUrl = channel.getImageUrl(); this.localImagePath = channel.getLocalImageUri(); }
public void updateTitleForOpenGroup() { try { if (channel != null) { Channel newChannel = ChannelService.getInstance(getActivity()).getChannelByChannelKey(channel.getKey()); if (getActivity() != null) { setToolbarTitle(newChannel.getName()); } } updateChannelSubTitle(); } catch (Exception e) { e.printStackTrace(); } }
protected void setChannel(Channel channel) { this.channel = channel; if (channel != null && !ChannelService.getInstance(getContext()).isUserAlreadyPresentInChannel(channel.getKey(), MobiComUserPreference.getInstance(getContext()).getUserId()) && messageTemplate != null && messageTemplate.isEnabled() && templateAdapter != null) { templateAdapter.removeTemplates(); } }
public void updateChannelTitle() { if (!Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { Channel newChannel = ChannelService.getInstance(getActivity()).getChannelByChannelKey(channel.getKey()); if (newChannel != null && !TextUtils.isEmpty(channel.getName()) && !channel.getName().equals(newChannel.getName())) { title = ChannelUtils.getChannelTitleName(newChannel, MobiComUserPreference.getInstance(getActivity()).getUserId()); channel = newChannel; if (getActivity() != null) { setToolbarTitle(title); } } } }