-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add emoji reactions to message bubbles (#1421)
* Add tapback emojis to message bubbles Added TapBackEmojiItem composable to display tapback emojis. Included it in MessageItem composable for incoming messages. Added a FlowRow to show tapback emojis below the message bubble. * feat: Add EmojiPicker View * feat: show emojis for local messages * feat: Add emoji tapbacks to messages This commit introduces the ability to send and receive emoji tapbacks for messages. - Adds emoji and replyId fields to DataPacket. - Adds emoji tapback support to the MeshService - Modifies UIState to handle emojis in message lists. * feat: store tapbacks in database Store tapbacks in the database and display them in the message list. - Add a new table to the database to store tapbacks. - Add a new DAO method to insert and retrieve tapbacks. - Update the message list UI to display tapbacks. * refactor: relation db and other changes --------- Co-authored-by: Andre K <[email protected]>
- Loading branch information
1 parent
b3f4929
commit 2234f5a
Showing
15 changed files
with
1,048 additions
and
186 deletions.
There are no files selected for viewing
515 changes: 515 additions & 0 deletions
515
app/schemas/com.geeksville.mesh.database.MeshtasticDatabase/14.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
179 changes: 91 additions & 88 deletions
179
app/src/main/java/com/geeksville/mesh/database/MeshtasticDatabase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,91 @@ | ||
/* | ||
* Copyright (c) 2024 Meshtastic LLC | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.geeksville.mesh.database | ||
|
||
import android.content.Context | ||
import androidx.room.AutoMigration | ||
import androidx.room.Database | ||
import androidx.room.DeleteTable | ||
import androidx.room.Room | ||
import androidx.room.RoomDatabase | ||
import androidx.room.TypeConverters | ||
import androidx.room.migration.AutoMigrationSpec | ||
import com.geeksville.mesh.database.dao.PacketDao | ||
import com.geeksville.mesh.database.dao.MeshLogDao | ||
import com.geeksville.mesh.database.dao.NodeInfoDao | ||
import com.geeksville.mesh.database.dao.QuickChatActionDao | ||
import com.geeksville.mesh.database.entity.ContactSettings | ||
import com.geeksville.mesh.database.entity.MeshLog | ||
import com.geeksville.mesh.database.entity.MyNodeEntity | ||
import com.geeksville.mesh.database.entity.NodeEntity | ||
import com.geeksville.mesh.database.entity.Packet | ||
import com.geeksville.mesh.database.entity.QuickChatAction | ||
|
||
@Database( | ||
entities = [ | ||
MyNodeEntity::class, | ||
NodeEntity::class, | ||
Packet::class, | ||
ContactSettings::class, | ||
MeshLog::class, | ||
QuickChatAction::class | ||
], | ||
autoMigrations = [ | ||
AutoMigration(from = 3, to = 4), | ||
AutoMigration(from = 4, to = 5), | ||
AutoMigration(from = 5, to = 6), | ||
AutoMigration(from = 6, to = 7), | ||
AutoMigration(from = 7, to = 8), | ||
AutoMigration(from = 8, to = 9), | ||
AutoMigration(from = 9, to = 10), | ||
AutoMigration(from = 10, to = 11), | ||
AutoMigration(from = 11, to = 12), | ||
AutoMigration(from = 12, to = 13, spec = AutoMigration12to13::class), | ||
], | ||
version = 13, | ||
exportSchema = true, | ||
) | ||
@TypeConverters(Converters::class) | ||
abstract class MeshtasticDatabase : RoomDatabase() { | ||
abstract fun nodeInfoDao(): NodeInfoDao | ||
abstract fun packetDao(): PacketDao | ||
abstract fun meshLogDao(): MeshLogDao | ||
abstract fun quickChatActionDao(): QuickChatActionDao | ||
|
||
companion object { | ||
fun getDatabase(context: Context): MeshtasticDatabase { | ||
|
||
return Room.databaseBuilder( | ||
context.applicationContext, | ||
MeshtasticDatabase::class.java, | ||
"meshtastic_database" | ||
) | ||
.fallbackToDestructiveMigration() | ||
.build() | ||
} | ||
} | ||
} | ||
|
||
@DeleteTable.Entries( | ||
DeleteTable(tableName = "NodeInfo"), | ||
DeleteTable(tableName = "MyNodeInfo") | ||
) | ||
class AutoMigration12to13 : AutoMigrationSpec | ||
/* | ||
* Copyright (c) 2024 Meshtastic LLC | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.geeksville.mesh.database | ||
|
||
import android.content.Context | ||
import androidx.room.AutoMigration | ||
import androidx.room.Database | ||
import androidx.room.DeleteTable | ||
import androidx.room.Room | ||
import androidx.room.RoomDatabase | ||
import androidx.room.TypeConverters | ||
import androidx.room.migration.AutoMigrationSpec | ||
import com.geeksville.mesh.database.dao.PacketDao | ||
import com.geeksville.mesh.database.dao.MeshLogDao | ||
import com.geeksville.mesh.database.dao.NodeInfoDao | ||
import com.geeksville.mesh.database.dao.QuickChatActionDao | ||
import com.geeksville.mesh.database.entity.ContactSettings | ||
import com.geeksville.mesh.database.entity.MeshLog | ||
import com.geeksville.mesh.database.entity.MyNodeEntity | ||
import com.geeksville.mesh.database.entity.NodeEntity | ||
import com.geeksville.mesh.database.entity.Packet | ||
import com.geeksville.mesh.database.entity.QuickChatAction | ||
import com.geeksville.mesh.database.entity.ReactionEntity | ||
|
||
@Database( | ||
entities = [ | ||
MyNodeEntity::class, | ||
NodeEntity::class, | ||
Packet::class, | ||
ContactSettings::class, | ||
MeshLog::class, | ||
QuickChatAction::class, | ||
ReactionEntity::class, | ||
], | ||
autoMigrations = [ | ||
AutoMigration(from = 3, to = 4), | ||
AutoMigration(from = 4, to = 5), | ||
AutoMigration(from = 5, to = 6), | ||
AutoMigration(from = 6, to = 7), | ||
AutoMigration(from = 7, to = 8), | ||
AutoMigration(from = 8, to = 9), | ||
AutoMigration(from = 9, to = 10), | ||
AutoMigration(from = 10, to = 11), | ||
AutoMigration(from = 11, to = 12), | ||
AutoMigration(from = 12, to = 13, spec = AutoMigration12to13::class), | ||
AutoMigration(from = 13, to = 14), | ||
], | ||
version = 14, | ||
exportSchema = true, | ||
) | ||
@TypeConverters(Converters::class) | ||
abstract class MeshtasticDatabase : RoomDatabase() { | ||
abstract fun nodeInfoDao(): NodeInfoDao | ||
abstract fun packetDao(): PacketDao | ||
abstract fun meshLogDao(): MeshLogDao | ||
abstract fun quickChatActionDao(): QuickChatActionDao | ||
|
||
companion object { | ||
fun getDatabase(context: Context): MeshtasticDatabase { | ||
|
||
return Room.databaseBuilder( | ||
context.applicationContext, | ||
MeshtasticDatabase::class.java, | ||
"meshtastic_database" | ||
) | ||
.fallbackToDestructiveMigration() | ||
.build() | ||
} | ||
} | ||
} | ||
|
||
@DeleteTable.Entries( | ||
DeleteTable(tableName = "NodeInfo"), | ||
DeleteTable(tableName = "MyNodeInfo") | ||
) | ||
class AutoMigration12to13 : AutoMigrationSpec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.