|
@@ -300,27 +300,27 @@ class Incoming(private val context: Context) {
|
|
val jsonObject = jsonArray.getJSONObject(i)
|
|
val jsonObject = jsonArray.getJSONObject(i)
|
|
ApiRoomDatabase.getDatabase(context).groupDao().insert(
|
|
ApiRoomDatabase.getDatabase(context).groupDao().insert(
|
|
Group(
|
|
Group(
|
|
- jsonObject.optString("A04") ?: "",
|
|
|
|
- jsonObject.optString("A05") ?: "",
|
|
|
|
- jsonObject.optString("A06") ?: "",
|
|
|
|
- jsonObject.optString("A74") ?: "",
|
|
|
|
- jsonObject.optString("A16") ?: "",
|
|
|
|
- jsonObject.optString("A11") ?: "0",
|
|
|
|
- jsonObject.optString("A28") ?: "",
|
|
|
|
- jsonObject.optString("A29") ?: "0",
|
|
|
|
- jsonObject.optString("A43") ?: "",
|
|
|
|
- "",
|
|
|
|
- jsonObject.optInt("B0") ?: 0,
|
|
|
|
- jsonObject.optInt("A122") ?: 0,
|
|
|
|
- jsonObject.optString("BP") ?: "",
|
|
|
|
- jsonObject.optString("A103") ?: "",
|
|
|
|
- 0,
|
|
|
|
- jsonObject.optInt("IOP") ?: 0,
|
|
|
|
- jsonObject.optInt("oacc") ?: 0,
|
|
|
|
- jsonObject.optInt("lvledu") ?: 0,
|
|
|
|
- jsonObject.optInt("mtredu") ?: 0,
|
|
|
|
- jsonObject.optInt("IED") ?: 0,
|
|
|
|
- jsonObject.optString("BZ1") ?: ""
|
|
|
|
|
|
+ group_id = jsonObject.optString("A04") ?: "",
|
|
|
|
+ f_name = jsonObject.optString("A05") ?: "",
|
|
|
|
+ scope_id = jsonObject.optString("A06") ?: "",
|
|
|
|
+ image_id = jsonObject.optString("A74") ?: "",
|
|
|
|
+ quote = jsonObject.optString("A16") ?: "",
|
|
|
|
+ last_update = jsonObject.optString("A11") ?: "0",
|
|
|
|
+ created_by = jsonObject.optString("A28") ?: "",
|
|
|
|
+ created_date = jsonObject.optString("A29") ?: "0",
|
|
|
|
+ ex_block = jsonObject.optString("A43") ?: "",
|
|
|
|
+ folder_id = "",
|
|
|
|
+ chat_modifier = jsonObject.optInt("B0"),
|
|
|
|
+ group_type = jsonObject.optInt("A122"),
|
|
|
|
+ parent = jsonObject.optString("BP") ?: "",
|
|
|
|
+ level = jsonObject.optString("A103") ?: "",
|
|
|
|
+ muted = 0,
|
|
|
|
+ is_open = jsonObject.optInt("IOP"),
|
|
|
|
+ official = jsonObject.optInt("oacc"),
|
|
|
|
+ level_edu = jsonObject.optInt("lvledu"),
|
|
|
|
+ materi_edu = jsonObject.optInt("mtredu"),
|
|
|
|
+ is_education = jsonObject.optInt("IED"),
|
|
|
|
+ be = jsonObject.optString("BZ1") ?: ""
|
|
)
|
|
)
|
|
)
|
|
)
|
|
val members = JSONArray(jsonObject.getString("member"))
|
|
val members = JSONArray(jsonObject.getString("member"))
|
|
@@ -328,17 +328,18 @@ class Incoming(private val context: Context) {
|
|
val jsonMember = members.getJSONObject(j)
|
|
val jsonMember = members.getJSONObject(j)
|
|
ApiRoomDatabase.getDatabase(context).groupMemberDao().insert(
|
|
ApiRoomDatabase.getDatabase(context).groupMemberDao().insert(
|
|
GroupMember(
|
|
GroupMember(
|
|
- jsonMember.optString("A04") ?: "",
|
|
|
|
- jsonMember.optString("A00") ?: "",
|
|
|
|
- jsonMember.optString("A80") ?: "",
|
|
|
|
- jsonMember.optString("B7") ?: "",
|
|
|
|
- jsonMember.optString("AC") ?: "",
|
|
|
|
- jsonMember.optString("AC_DESC") ?: "",
|
|
|
|
- jsonMember.optString("A02") ?: "",
|
|
|
|
- jsonMember.optString("A03") ?: "",
|
|
|
|
- jsonMember.optString("B5") ?: "",
|
|
|
|
- jsonMember.optString("A74") ?: "",
|
|
|
|
- jsonMember.optString("A29") ?: System.currentTimeMillis().toString(),
|
|
|
|
|
|
+ group_id = jsonMember.optString("A04") ?: "",
|
|
|
|
+ f_pin = jsonMember.optString("A00") ?: "",
|
|
|
|
+ position = jsonMember.optString("A80") ?: "",
|
|
|
|
+ user_id = jsonMember.optString("B7") ?: "",
|
|
|
|
+ ac = jsonMember.optString("AC") ?: "",
|
|
|
|
+ ac_desc = jsonMember.optString("AC_DESC") ?: "",
|
|
|
|
+ first_name = jsonMember.optString("A02") ?: "",
|
|
|
|
+ last_name = jsonMember.optString("A03") ?: "",
|
|
|
|
+ msisdn = jsonMember.optString("B5") ?: "",
|
|
|
|
+ thumb_id = jsonMember.optString("A74") ?: "",
|
|
|
|
+ created_date = jsonMember.optString("A29") ?: System.currentTimeMillis()
|
|
|
|
+ .toString(),
|
|
)
|
|
)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -354,17 +355,17 @@ class Incoming(private val context: Context) {
|
|
val me = context.getSharedPreferences().getString("pin", null)
|
|
val me = context.getSharedPreferences().getString("pin", null)
|
|
ApiRoomDatabase.getDatabase(context).groupMemberDao().insert(
|
|
ApiRoomDatabase.getDatabase(context).groupMemberDao().insert(
|
|
GroupMember(
|
|
GroupMember(
|
|
- data.bodies["A04"] ?: "",
|
|
|
|
- data.bodies["A00"] ?: "",
|
|
|
|
- data.bodies["A80"] ?: "",
|
|
|
|
- data.bodies["B7"] ?: "",
|
|
|
|
- data.bodies["AC"] ?: "",
|
|
|
|
- data.bodies["AC_DESC"] ?: "",
|
|
|
|
- data.bodies["A02"] ?: "",
|
|
|
|
- data.bodies["A03"] ?: "",
|
|
|
|
- data.bodies["B5"] ?: "",
|
|
|
|
- data.bodies["A74"] ?: "",
|
|
|
|
- data.bodies["A29"] ?: System.currentTimeMillis().toString(),
|
|
|
|
|
|
+ group_id = data.bodies["A04"] ?: "",
|
|
|
|
+ f_pin = data.bodies["A00"] ?: "",
|
|
|
|
+ position = data.bodies["A80"] ?: "",
|
|
|
|
+ user_id = data.bodies["B7"] ?: "",
|
|
|
|
+ ac = data.bodies["AC"] ?: "",
|
|
|
|
+ ac_desc = data.bodies["AC_DESC"] ?: "",
|
|
|
|
+ first_name = data.bodies["A02"] ?: "",
|
|
|
|
+ last_name = data.bodies["A03"] ?: "",
|
|
|
|
+ msisdn = data.bodies["B5"] ?: "",
|
|
|
|
+ thumb_id = data.bodies["A74"] ?: "",
|
|
|
|
+ created_date = data.bodies["A29"] ?: System.currentTimeMillis().toString(),
|
|
)
|
|
)
|
|
)
|
|
)
|
|
Service.sendAck(me, data.status)
|
|
Service.sendAck(me, data.status)
|
|
@@ -389,9 +390,11 @@ class Incoming(private val context: Context) {
|
|
val chatId = data.bodies["BA"] ?: ""
|
|
val chatId = data.bodies["BA"] ?: ""
|
|
val imageId = data.bodies["A57"]
|
|
val imageId = data.bodies["A57"]
|
|
var uri: Uri? = null
|
|
var uri: Uri? = null
|
|
- Log.d(tag, "data.media:${data.media.size}")
|
|
|
|
imageId?.let { fileName ->
|
|
imageId?.let { fileName ->
|
|
- uri = Network().download(context, "https://digixplatform.com/filepalio/image/$fileName")
|
|
|
|
|
|
+ uri = Network().download(
|
|
|
|
+ context,
|
|
|
|
+ "https://digixplatform.com/filepalio/image/$fileName"
|
|
|
|
+ )
|
|
}
|
|
}
|
|
ApiRoomDatabase.getDatabase(context).messageDao().insert(
|
|
ApiRoomDatabase.getDatabase(context).messageDao().insert(
|
|
Message(
|
|
Message(
|