private void TL_messages_StatedMessage(TL.Object obj) { setUpdate(-1, obj.getInt("pts"), obj.getInt("seq")); User.addUsers(obj.getVector("users")); TL.Object message = obj.getObject("message"); Dialog d = Dialog.getDialog(message.getInt("from_id"), message.getObject("to_id"), true); Dialog.newMessage(message, Dialog.MSG_INCOMING); }
private void TL_messages_StatedMessages(TL.Object obj) { setUpdate(-1, obj.getInt("pts"), obj.getInt("seq")); User.addUsers(obj.getVector("users")); TL.Vector messages = obj.getVector("messages"); for (int i = 0; i < messages.count; i++) { TL.Object message = messages.getObject(i); Dialog d = Dialog.getDialog(message.getInt("from_id"), message.getObject("to_id"), true); Dialog.newMessage(message, Dialog.MSG_INCOMING); } }
private void TL_updates_Difference(TL.Object obj) { if (obj.name.equals("updates.differenceEmpty")) setUpdate(obj.getInt("date"), -1, obj.getInt("seq")); if (obj.name.equals("updates.difference") || obj.name.equals("updates.differenceSlice")) { TL.Vector other_updates = obj.getVector("other_updates"); for (int i = 0; i < other_updates.count; i++) onUpdate(other_updates.getObject(i), obj.getVector("users"), obj.getVector("chats")); TL.Vector new_messages = obj.getVector("new_messages"); for (int i = 0; i < new_messages.count; i++) Dialog.newMessage(new_messages.getObject(i), Dialog.MSG_HISTORY); // if (new_messages.count > 0) // Dialog.vibrate(); if (obj.name.equals("updates.differenceSlice")) { TL_updates_State(obj.getObject("intermediate_state")); this.api_updates_getDifference(); } else TL_updates_State(obj.getObject("state")); } }