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 #32

Merged
merged 6 commits into from
Nov 4, 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
24 changes: 24 additions & 0 deletions .github/workflows/gradle_wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Validate Gradle Wrapper"

on:
push:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
pull_request:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
workflow_dispatch:
inputs:
version:
description: dummy
default: dummy

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.gradle.internal.impldep.org.codehaus.plexus.util.Os
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Binary file modified resources/common/ffmpeg_av_jni.dll
Binary file not shown.
Binary file modified resources/common/libffmpeg_av_jni.jnilib
Binary file not shown.
Binary file modified resources/common/libffmpeg_av_jni.so
Binary file not shown.
49 changes: 34 additions & 15 deletions src/main/kotlin/com/zoffcc/applications/trifa/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,8 @@ class MainActivity
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
val group_connection_status = tox_group_is_connected(group_number)
groupstore.update(item = GroupItem(name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
val group_num_peers = tox_group_peer_count(group_number)
groupstore.update(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
Expand All @@ -1804,7 +1805,8 @@ class MainActivity
{
val group_identifier: String = bytesToHex(Arrays.copyOfRange(invite_data, 0, GROUP_ID_LENGTH), 0, GROUP_ID_LENGTH).lowercase()
val new_privacy_state = tox_group_get_privacy_state(new_group_num)
groupstore.add(item = GroupItem(name = group_name!!, isConnected = 0, groupId = group_identifier, privacyState = new_privacy_state))
val group_num_peers = tox_group_peer_count(new_group_num)
groupstore.add(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = 0, groupId = group_identifier, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
Expand All @@ -1814,6 +1816,18 @@ class MainActivity
@JvmStatic
fun android_tox_callback_group_peer_join_cb_method(group_number: Long, peer_id: Long)
{
try
{
val new_privacy_state = tox_group_get_privacy_state(group_number)
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
val group_connection_status = tox_group_is_connected(group_number)
val group_num_peers = tox_group_peer_count(group_number)
groupstore.update(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}

try
{
val group_id = tox_group_by_groupnum__wrapper(group_number)
Expand All @@ -1833,16 +1847,6 @@ class MainActivity
{
}

try
{
val new_privacy_state = tox_group_get_privacy_state(group_number)
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
val group_connection_status = tox_group_is_connected(group_number)
groupstore.update(item = GroupItem(name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
update_savedata_file_wrapper()
}

Expand All @@ -1863,6 +1867,18 @@ class MainActivity
} catch (_: Exception)
{
}

try
{
val new_privacy_state = tox_group_get_privacy_state(group_number)
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
val group_connection_status = tox_group_is_connected(group_number)
val group_num_peers = tox_group_peer_count(group_number)
groupstore.update(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
update_savedata_file_wrapper()
}

Expand Down Expand Up @@ -1899,7 +1915,8 @@ class MainActivity
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
val group_connection_status = tox_group_is_connected(group_number)
groupstore.update(item = GroupItem(name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
val group_num_peers = tox_group_peer_count(group_number)
groupstore.update(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
Expand All @@ -1915,7 +1932,8 @@ class MainActivity
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
val group_connection_status = tox_group_is_connected(group_number)
groupstore.update(item = GroupItem(name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
val group_num_peers = tox_group_peer_count(group_number)
groupstore.update(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = group_connection_status, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
Expand All @@ -1936,7 +1954,8 @@ class MainActivity
val new_privacy_state = tox_group_get_privacy_state(group_number)
val group_id = tox_group_by_groupnum__wrapper(group_number)
val group_name = tox_group_get_name(group_number)
groupstore.update(item = GroupItem(name = group_name!!, isConnected = a_TOX_GROUP_CONNECTION_STATUS, groupId = group_id, privacyState = new_privacy_state))
val group_num_peers = tox_group_peer_count(group_number)
groupstore.update(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name!!, isConnected = a_TOX_GROUP_CONNECTION_STATUS, groupId = group_id, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,17 @@ class TrifaToxService
val groupid_buffer = ByteArray(GROUP_ID_LENGTH)
groupid_buf3.get(groupid_buffer, 0, GROUP_ID_LENGTH)
val group_identifier: String = HelperGeneric.bytesToHex(groupid_buffer, 0, GROUP_ID_LENGTH).lowercase()
val is_connected: Int = tox_group_is_connected(conf_.toLong())
val is_connected: Int = tox_group_is_connected(group_numbers!![conf_])
var group_name: String? = tox_group_get_name(group_numbers!![conf_])
val group_num_peers = tox_group_peer_count(group_numbers!![conf_])
if (group_name == null)
{
group_name = ""
}
val new_privacy_state: Int = tox_group_get_privacy_state(group_numbers!![conf_])
try
{
groupstore.add(item = GroupItem(name = group_name, isConnected = is_connected, groupId = group_identifier, privacyState = new_privacy_state))
groupstore.add(item = GroupItem(numPeers = group_num_peers.toInt(), name = group_name, isConnected = is_connected, groupId = group_identifier, privacyState = new_privacy_state))
} catch (_: Exception)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

package org.briarproject.briar.desktop.contact

import com.zoffcc.applications.trifa.ToxVars.TOX_GROUP_PRIVACY_STATE

data class GroupItem(
val name: String,
val isConnected: Int,
val numPeers: Int,
val groupId: String,
val privacyState: Int
) {
Expand All @@ -32,6 +31,9 @@ data class GroupItem(
fun updateGroupId(groupId: String) =
copy(groupId = groupId)

fun updateNumPeers(numPeers: Int) =
copy(numPeers = numPeers)

fun updateIsConnected(isConnected: Int) =
copy(isConnected = isConnected)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fun GroupItemView(
)
PeerCountCircle(
modifier = Modifier.padding(end = 1.dp).requiredSize(28.dp),
peerCount = (tox_group_peer_count(HelperGroup.tox_group_by_groupid__wrapper(groupItem.groupId)))
peerCount = groupItem.numPeers.toLong()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun GroupList(
ContextMenuArea(items = {
listOf(
ContextMenuItem("delete") {
groupstore.remove(item = GroupItem(privacyState = 0, name = "", isConnected = 0, groupId = item.groupId))
groupstore.remove(item = GroupItem(privacyState = 0, name = "", isConnected = 0, groupId = item.groupId, numPeers = 0))
GlobalScope.launch(Dispatchers.IO) {
HelperGeneric.delete_group_wrapper(item.groupId)
}
Expand Down
Loading