Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #93

Merged
merged 6 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asan_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.6.0.0 \
/usr/lib/jvm/java-17-openjdk-amd64/bin/java -Dapple.awt.application.name=TRIfA \
-Dcom.apple.mrj.application.apple.menu.about.name=TRIfA -Dcompose.application.configure.swing.globals=true -Dcompose.application.resources.dir="$p"/build/compose/tmp/prepareAppResources -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant \
-cp "$p"/build/compose/jars/trifa_material-linux-x64-1.0.10.jar \
-cp "$p"/build/compose/jars/trifa_material-linux-x64-1.0.11.jar \
MainKt

# -cp "$p"/build/libs/trifa_material-1.0.8.jar:\
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zoffcc/applications/sorm/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class Message
public int msg_version; // 0 -> old Message, 1 -> for MessageV2 Message

@Column(indexed = true, defaultExpr = "2")
public int resend_count; // 2 -> do not resend msg anymore, 0 or 1 -> resend count
public int resend_count; // for msgV2 "> 1" -> do not resend msg anymore, 0 or 1 -> resend count

@Column(indexed = true, defaultExpr = "false", helpers = Column.Helpers.ALL)
public boolean ft_outgoing_queued = false;
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/zoffcc/applications/trifa/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1817,8 +1817,8 @@ class MainActivity
m.raw_msgv2_bytes = ""
m.rcvd_timestamp = System.currentTimeMillis()
m.read = true
HelperMessage.update_message_in_db_read_rcvd_timestamp_rawmsgbytes(m)
m.resend_count = 2
update_message_in_db_read_rcvd_timestamp_rawmsgbytes(m)
m.resend_count = TRIFAGlobals.MAX_TEXTMSG_RESEND_COUNT_OLDMSG_VERSION
HelperMessage.update_message_in_db_resend_count(m)
}
catch(_: Exception)
Expand Down
27 changes: 14 additions & 13 deletions src/main/kotlin/com/zoffcc/applications/trifa/TrifaToxService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,6 @@ class TrifaToxService

fun resend_v3_messages(friend_pubkey: String?)
{
return

// loop through "old msg version" msgV3 1-on-1 text messages that have "resend_count < MAX_TEXTMSG_RESEND_COUNT_OLDMSG_VERSION" --------------
try
{
Expand Down Expand Up @@ -1008,11 +1006,16 @@ class TrifaToxService
continue
}
}
Log.i(TAG, "resend_v3_messages:get_friend_msgv3_capability=" + get_friend_msgv3_capability(m_resend_v1.tox_friendpubkey))
if (get_friend_msgv3_capability(m_resend_v1.tox_friendpubkey) != 1L)
{
Log.i(TAG, "resend_v3_messages:RET:02:friend hash msgv3_capability:" +
get_friend_name_from_pubkey(m_resend_v1.tox_friendpubkey))
continue
}
tox_friend_resend_msgv3_wrapper(m_resend_v1)
Log.i(TAG, "resend_v3_messages:tox_friend_resend_msgv3_wrapper:" + m_resend_v1.text + " : m=" +
m_resend_v1 + " : " + get_friend_name_from_pubkey(m_resend_v1.tox_friendpubkey));
// ** // tox_friend_resend_msgv3_wrapper(m_resend_v1)
cur_resend_count_per_iteration++
if (cur_resend_count_per_iteration >= max_resend_count_per_iteration)
{
Expand All @@ -1030,8 +1033,6 @@ class TrifaToxService

fun resend_old_messages(friend_pubkey: String?)
{
return

try
{
var max_resend_count_per_iteration = 10
Expand All @@ -1048,11 +1049,11 @@ class TrifaToxService
// HINT: this is the generic resend for all friends, that happens in regular intervals
// only resend if the original sent timestamp is at least 25 seconds in the past
// to try to avoid resending when the read receipt is very late.
orma!!.selectFromMessage().directionEq(1).TRIFA_MESSAGE_TYPEEq(TRIFAGlobals.TRIFA_MSG_TYPE.TRIFA_MSG_TYPE_TEXT.value).msg_versionEq(0).tox_friendpubkeyEq(friend_pubkey).readEq(false).resend_countLt(2).orderBySent_timestampAsc().sent_timestampLt(cutoff_sent_time).toList()
orma!!.selectFromMessage().directionEq(1).TRIFA_MESSAGE_TYPEEq(TRIFAGlobals.TRIFA_MSG_TYPE.TRIFA_MSG_TYPE_TEXT.value).msg_versionEq(0).tox_friendpubkeyEq(friend_pubkey).readEq(false).resend_countLt(MAX_TEXTMSG_RESEND_COUNT_OLDMSG_VERSION).orderBySent_timestampAsc().sent_timestampLt(cutoff_sent_time).toList()
} else
{
// HINT: this is the specific resend for 1 friend only, when that friend comes online
orma!!.selectFromMessage().directionEq(1).TRIFA_MESSAGE_TYPEEq(TRIFAGlobals.TRIFA_MSG_TYPE.TRIFA_MSG_TYPE_TEXT.value).msg_versionEq(0).readEq(false).resend_countLt(2).orderBySent_timestampAsc().toList()
orma!!.selectFromMessage().directionEq(1).TRIFA_MESSAGE_TYPEEq(TRIFAGlobals.TRIFA_MSG_TYPE.TRIFA_MSG_TYPE_TEXT.value).msg_versionEq(0).readEq(false).resend_countLt(MAX_TEXTMSG_RESEND_COUNT_OLDMSG_VERSION).orderBySent_timestampAsc().toList()
}
if (m_v0 != null && m_v0.size > 0)
{
Expand All @@ -1075,19 +1076,19 @@ class TrifaToxService
{
if (is_friend_online_real(tox_friend_by_public_key(m_resend_v0.tox_friendpubkey)) == 0)
{
// Log.i(TAG, "resend_old_messages:RET:01:" +
// get_friend_name_from_pubkey(m_resend_v0.tox_friendpubkey));
Log.i(TAG, "resend_old_messages:RET:01:" +
get_friend_name_from_pubkey(m_resend_v0.tox_friendpubkey))
continue
}
}
if (get_friend_msgv3_capability(m_resend_v0.tox_friendpubkey) == 1L)
{
// Log.i(TAG, "resend_old_messages:RET:02:" +
// get_friend_name_from_pubkey(m_resend_v0.tox_friendpubkey));
Log.i(TAG, "resend_old_messages:RET:02:friend hash msgv3_capability:" +
get_friend_name_from_pubkey(m_resend_v0.tox_friendpubkey))
continue
}
// Log.i(TAG, "resend_old_messages:tox_friend_resend_msgv3_wrapper:" + m_resend_v0.text + " : m=" +
// m_resend_v0 + " : " + get_friend_name_from_pubkey(m_resend_v0.tox_friendpubkey));
Log.i(TAG, "resend_old_messages:tox_friend_resend_msgv3_wrapper:" + m_resend_v0.text + " : m=" +
m_resend_v0 + " : " + get_friend_name_from_pubkey(m_resend_v0.tox_friendpubkey))
tox_friend_resend_msgv3_wrapper(m_resend_v0)
cur_resend_count_per_iteration++
if (cur_resend_count_per_iteration >= max_resend_count_per_iteration)
Expand Down
12 changes: 12 additions & 0 deletions src/main/kotlin/org/briarproject/briar/desktop/ui/AddGroup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand Down Expand Up @@ -150,6 +151,17 @@ fun AddGroup() = Box {
Text("join the Public Information Group")
}
}
Spacer(modifier = Modifier.height(30.dp))
Row {
Spacer(modifier = Modifier.width(35.dp))
Text(fontWeight = FontWeight.ExtraBold,
fontSize = 16.sp,
text ="Important Notice: ")
Text(fontWeight = FontWeight.Normal,
fontSize = 16.sp,
text ="Joining a Tox Public group for the first time can take a long time, even up to 30 minutes")
}
Spacer(modifier = Modifier.height(30.dp))
}
}

Loading