use of net.iGap.network.AbstractObject in project iGap-Android by KianIranian-STDG.
the class MessageController method getStories.
public void getStories(int contactCount) {
AbstractObject req = null;
IG_RPC.Get_Stories get_stories = new IG_RPC.Get_Stories();
get_stories.offset = 0;
get_stories.limit = contactCount;
req = get_stories;
getRequestManager().sendRequest(req, (response, error) -> {
if (error == null) {
IG_RPC.Res_Get_Stories res = (IG_RPC.Res_Get_Stories) response;
if (res.stories.size() > 0) {
getMessageDataStorage().updateUserAddedStoryWithStoryObjects(res.stories);
}
} else {
}
});
}
use of net.iGap.network.AbstractObject in project iGap-Android by KianIranian-STDG.
the class MessageController method pinMessage.
public void pinMessage(long roomId, long messageId, long documentId, int chatType) {
AbstractObject req = null;
if (chatType == GROUP_VALUE) {
IG_RPC.Group_pin_message group_pin_message = new IG_RPC.Group_pin_message();
group_pin_message.roomId = roomId;
group_pin_message.messageId = messageId;
group_pin_message.documentId = documentId;
req = group_pin_message;
} else if (chatType == ProtoGlobal.Room.Type.CHANNEL_VALUE) {
IG_RPC.Channel_pin_message channel_pin_message = new IG_RPC.Channel_pin_message();
channel_pin_message.messageId = messageId;
channel_pin_message.documentId = documentId;
channel_pin_message.roomId = roomId;
req = channel_pin_message;
}
getRequestManager().sendRequest(req, (response, error) -> {
if (response != null) {
onPinMessageResponse(response);
} else {
IG_RPC.Error err = (IG_RPC.Error) error;
FileLog.e("Pin message -> Major: " + err.minor + " Minor: " + err.minor);
}
});
}
use of net.iGap.network.AbstractObject in project iGap-Android by KianIranian-STDG.
the class MessageController method deleteSelectedMessage.
public void deleteSelectedMessage(int roomType, long roomId, ArrayList<Long> messageIds, ArrayList<Long> documentIds, ArrayList<Long> bothMessageIds) {
AbstractObject req = null;
boolean bothDelete = false;
for (int i = 0; i < messageIds.size(); i++) {
if (bothMessageIds != null && bothMessageIds.contains(messageIds.get(i))) {
bothDelete = true;
}
if (roomType == CHAT_VALUE) {
IG_RPC.Chat_Delete_Message chat_delete_message = new IG_RPC.Chat_Delete_Message();
chat_delete_message.roomId = roomId;
chat_delete_message.messageId = messageIds.get(i);
chat_delete_message.documentId = documentIds.get(i);
chat_delete_message.both = bothDelete;
req = chat_delete_message;
} else if (roomType == GROUP_VALUE) {
IG_RPC.Group_Delete_Message group_delete_message = new IG_RPC.Group_Delete_Message();
group_delete_message.roomId = roomId;
group_delete_message.messageId = messageIds.get(i);
group_delete_message.documentId = documentIds.get(i);
req = group_delete_message;
} else if (roomType == ProtoGlobal.Room.Type.CHANNEL_VALUE) {
IG_RPC.Channel_Delete_Message channel_delete_message = new IG_RPC.Channel_Delete_Message();
channel_delete_message.roomId = roomId;
channel_delete_message.messageId = messageIds.get(i);
channel_delete_message.documentId = documentIds.get(i);
req = channel_delete_message;
}
getRequestManager().sendRequest(req, (response, error) -> {
if (response != null) {
onDeleteMessageResponse(response, false);
} else {
IG_RPC.Error e = (IG_RPC.Error) error;
FileLog.e("Delete Message -> Major:" + e.major + "Minor:" + e.minor);
}
});
}
}
use of net.iGap.network.AbstractObject in project iGap-Android by KianIranian-STDG.
the class MessageController method addMyRoomStory.
public void addMyRoomStory(List<ProtoStoryUserAddNew.StoryAddRequest> storyObjects, long roomId) {
isSendingRoomStory = true;
HttpUploader.isMultiUpload = false;
HttpUploader.isRoomMultiUpload = false;
AbstractObject request = null;
IG_RPC.Story_Room_Add_New story_room_add_new = new IG_RPC.Story_Room_Add_New();
story_room_add_new.storyAddRequests = storyObjects;
story_room_add_new.roomId = roomId;
request = story_room_add_new;
getRequestManager().sendRequest(request, (response, error) -> {
if (error == null) {
IG_RPC.Res_Story_Room_Add_New res = (IG_RPC.Res_Story_Room_Add_New) response;
getMessageDataStorage().updateRoomAddedStory(res.stories);
MessageController.isSendingRoomStory = false;
} else {
IG_RPC.Error err = (IG_RPC.Error) error;
MessageController.isSendingRoomStory = false;
G.runOnUiThread(() -> EventManager.getInstance(AccountManager.selectedAccount).postEvent(EventManager.STORY_UPLOADED_FAILED));
}
});
}
Aggregations