Skip to content

Commit

Permalink
Merge branch 'release/v7.1.0' into 'master'
Browse files Browse the repository at this point in the history
Release 7.1.0

See merge request megachat/MEGAchat!2001
  • Loading branch information
adlonMEGA committed Oct 17, 2024
2 parents 2757484 + 9e0db33 commit dcfb0db
Show file tree
Hide file tree
Showing 22 changed files with 650 additions and 179 deletions.
34 changes: 34 additions & 0 deletions bindings/java/nz/mega/sdk/MegaChatApiJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,17 @@ public void retryPendingConnections(boolean disconnect, MegaChatRequestListenerI
megaChatApi.retryPendingConnections(disconnect, createDelegateRequestListener(listener));
}

/**
* Refresh DNS servers and retry pending connections
*
* The associated request type with this request is MegaChatRequest::TYPE_RETRY_PENDING_CONNECTIONS
*
* @param disconnect boolean
*/
public void retryPendingConnections(boolean disconnect){
megaChatApi.retryPendingConnections(disconnect);
}

/**
* Refresh URLs and establish fresh connections
*
Expand Down Expand Up @@ -1750,6 +1761,29 @@ public void requestLastGreen(long userid, MegaChatRequestListenerInterface liste
megaChatApi.requestLastGreen(userid, createDelegateRequestListener(listener));
}

/**
* Request the number of minutes since the user was seen as green by last time.
*
* Apps may call this function to retrieve the minutes elapsed since the user was seen
* as green (MegaChatApi::STATUS_ONLINE) by last time.
* Apps must NOT call this function if the current status of the user is already green.
*
* The number of minutes since the user was seen as green by last time, if any, will
* be notified in the MegaChatListener::onChatPresenceLastGreen callback. Note that,
* if the user was never seen green by presenced or the user has disabled the visibility
* of the last-green with MegaChatApi::setLastGreenVisible, there will be no notification
* at all.
*
* The associated request type with this request is MegaChatRequest::TYPE_LAST_GREEN
* Valid data in the MegaChatRequest object received on callbacks:
* - MegaChatRequest::getUserHandle() - Returns the handle of the user
*
* @param userid MegaChatHandle from user that last green has been requested
*/
public void requestLastGreen(long userid){
megaChatApi.requestLastGreen(userid);
}

/**
* Signal there is some user activity
*
Expand Down
1 change: 0 additions & 1 deletion examples/qtmegachatapi/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ void MainWindow::onSchedMeetingOccurrencesUpdate(MegaChatApi* /*api*/, MegaChatH

void MainWindow::closeEvent(QCloseEvent *event)
{
delete this;
event->accept();
}

Expand Down
7 changes: 6 additions & 1 deletion examples/qtmegachatapi/MegaChatApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ MegaChatApplication::~MegaChatApplication()
delete megaChatNotificationListenerDelegate;
delete megaChatRequestListenerDelegate;
delete megaListenerDelegate;
delete mMainWin;
if (mMainWin != nullptr)
{
delete mMainWin;
mMainWin = nullptr;
}
delete mMegaChatApi;
delete mMegaApi;
mMegaChatApi->setLoggerObject(nullptr);
delete mLogger;
delete [] mSid;
}
Expand Down
1 change: 1 addition & 0 deletions jenkinsfile/Jenkinsfile_MR_crossiOS
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pipeline {
timeout(time: 200, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '135', daysToKeepStr: '21'))
gitLabConnection('GitLabConnectionJenkins')
ansiColor('xterm')
}
environment {
BUILD_OPTIONS = ' '
Expand Down
6 changes: 3 additions & 3 deletions jenkinsfile/Jenkinsfile_MR_linux_cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pipeline {
steps{
dir(megachat_sources_workspace){
sh """
sed -i "s#MEGAChatTest#${env.USER_AGENT_TESTS}#g" tests/sdk_test/sdk_test.h
sed -i "s#MEGAChatTest#${env.USER_AGENT_TESTS_MEGACHAT}#g" tests/sdk_test/sdk_test.h
"""
sh "echo Building SDK"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=Debug -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
Expand Down Expand Up @@ -184,12 +184,12 @@ pipeline {
ulimit -c unlimited
if [ -z \"${TESTS_PARALLEL}\" ]; then
# Sequential run
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} &
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS_MEGACHAT} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} &
pid=\$!
wait \$pid || FAILED=1
else
# Parallel run
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} ${TESTS_PARALLEL} 2>&1 | tee tests.stdout
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS_MEGACHAT} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} ${TESTS_PARALLEL} 2>&1 | tee tests.stdout
[ \"\${PIPESTATUS[0]}\" != \"0\" ] && FAILED=1
fi
Expand Down
11 changes: 7 additions & 4 deletions jenkinsfile/Jenkinsfile_MR_macOS_cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,22 @@ pipeline {
MEGAQTPATH= "${env.HOME}/Qt-build/5.15.13/5.15.13/arm64"
}
steps{
script {
BUILD_TYPE = (env.gitlabTriggerPhrase != null && env.gitlabTriggerPhrase.contains('--upload_megaclc')) ? 'Release' : 'Debug'
}
dir(megachat_sources_workspace){
//Build for arm64
sh "echo Building for arm64"
sh "echo Building for arm64 in ${BUILD_TYPE} mode"
sh "mkdir ${BUILD_DIR}"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=Debug -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
-S ${megachat_sources_workspace} -B ${megachat_sources_workspace}/${BUILD_DIR} -DCMAKE_PREFIX_PATH=${MEGAQTPATH} \
-DCMAKE_OSX_ARCHITECTURES=arm64 -DENABLE_CHATLIB_QTAPP=OFF -DENABLE_CHATLIB_TESTS=ON -DUSE_FFMPEG=OFF -DUSE_FREEIMAGE=OFF"
sh "cmake --build ${megachat_sources_workspace}/${BUILD_DIR} -j3"

//build for x64
sh "echo \"Building for x64 (crosscompiling)\""
sh "echo Building for x64-crosscompiling in ${BUILD_TYPE} mode"
sh "mkdir ${BUILD_DIR_X64}"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=Debug -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_CHATLIB_QTAPP=OFF -DENABLE_CHATLIB_TESTS=ON -DUSE_FFMPEG=OFF -DUSE_FREEIMAGE=OFF \
-S ${megachat_sources_workspace} -B ${megachat_sources_workspace}/${BUILD_DIR_X64} -DCMAKE_PREFIX_PATH=${MEGAQTPATH}"
sh "cmake --build ${megachat_sources_workspace}/${BUILD_DIR_X64} -j3"
Expand Down
14 changes: 8 additions & 6 deletions jenkinsfile/Jenkinsfile_MR_windows_cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ pipeline {
BUILD_DIR = "build_dir"
}
steps{
script {
BUILD_TYPE = (env.gitlabTriggerPhrase != null && env.gitlabTriggerPhrase.contains('--upload_megaclc')) ? 'Release' : 'Debug'
}
dir(megachat_sources_workspace){
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=Debug -DVCPKG_ROOT='${VCPKGPATH}' ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
sh "echo Building in ${BUILD_TYPE} mode"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT='${VCPKGPATH}' ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_CHATLIB_QTAPP=OFF -DENABLE_CHATLIB_TESTS=ON -DUSE_FFMPEG=OFF -DUSE_FREEIMAGE=OFF \
-S '${megachat_sources_workspace}' -B '${megachat_sources_workspace}'\\\\${BUILD_DIR}\\\\"
sh "cmake --build '${megachat_sources_workspace}'\\\\${BUILD_DIR} -j2"
sh "cmake --build '${megachat_sources_workspace}'\\\\${BUILD_DIR} --config ${BUILD_TYPE} -j2"
}
script {
uploadMegaclcExecuted = false
Expand All @@ -133,7 +137,7 @@ pipeline {
JF_PATH = "${megachat_sources_workspace}\\.."
}
steps {
dir('build_dir\\examples\\megaclc\\Debug'){
dir('build_dir\\examples\\megaclc\\Release'){
script {
uploadMegaclcExecuted = true
def windows_artifactory_upload = { String ART_UPLOAD_PATH ->
Expand All @@ -152,9 +156,7 @@ pipeline {
}

post{
always{
deleteDir()
}

success {
script{
if (uploadMegaclcExecuted){
Expand Down
90 changes: 90 additions & 0 deletions jenkinsfile/specific_branches/MEGAChat_crossiOS_develop.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
pipeline {
agent { label 'osx && arm64' }
options {
buildDiscarder(logRotator(numToKeepStr: '135', daysToKeepStr: '21'))
gitLabConnection('GitLabConnectionJenkins')
ansiColor('xterm')
}
environment {
APIURL_TO_TEST = "https://g.api.mega.co.nz/"
IOS_BRANCH = "develop"
SDK_BRANCH = "develop"
MEGACHAT_BRANCH = "develop"
}
stages {
stage('Checkout SDK MEGAchat and iOS'){
steps {
deleteDir()
checkout([
$class: 'GitSCM',
branches: [[name: "origin/${env.IOS_BRANCH}"]],
userRemoteConfigs: [[ url: "[email protected]:mobile/ios/iOS_dev.git", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]],
extensions: [
[$class: "UserIdentity",name: "jenkins", email: "jenkins@jenkins"]
]
])
dir("Modules/DataSource/MEGAChatSDK/Sources/MEGAChatSDK"){
checkout([
$class: 'GitSCM',
branches: [[name: "origin/${env.MEGACHAT_BRANCH}"]],
userRemoteConfigs: [[ url: "[email protected]:megachat/MEGAchat.git", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]],
extensions: [
[$class: "UserIdentity",name: "jenkins", email: "jenkins@jenkins"],
]
])
}
dir('Modules/Datasource/MEGASDK/Sources/MEGASDK'){
checkout([
$class: 'GitSCM',
branches: [[name: "origin/${env.SDK_BRANCH}"]],
userRemoteConfigs: [[ url: "[email protected]:sdk/sdk.git", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]],
extensions: [
[$class: "UserIdentity",name: "jenkins", email: "jenkins@jenkins"]
]
])
}
sh """
git submodule update --init iMEGA/Vendor/SVProgressHUD
git submodule update --init iMEGA/Vendor/LTHPasscodeViewController
"""
script{
ios_sources_workspace = WORKSPACE
sdk_sources_workspace = "${ios_sources_workspace}/Modules/DataSource/MEGASDK/Sources/MEGASDK"
megachat_sources_workspace = "${ios_sources_workspace}/Modules/DataSource/MEGAChatSDK/Sources/MEGAChatSDK"
}
}
}
stage('Build MEGACHAT SDK and iOS'){
environment{
PATH = "/usr/local/bin:${env.PATH}"
LIBTOOLIZE = "/usr/local/bin/glibtoolize"
}
steps{
sh """
bundle config set --local path 'vendor/bundle'
bundle install
"""
dir("${megachat_sources_workspace}/src"){
sh """
cmake -P genDbSchema.cmake
"""
}
sh """
bundle exec fastlane configure_sdk_and_chat_library use_cache:true
"""
withCredentials([gitUsernamePassword(credentialsId: 'jenkins_sdk_token_with_user', gitToolName: 'Default')]) {
sh """
bundle exec fastlane update_plugins
bundle exec fastlane build_simulator
"""
}
}
}
}
post {
always {
deleteDir()
}
}
}
// vim: syntax=groovy tabstop=4 shiftwidth=4
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pipeline {
steps{
dir(megachat_sources_workspace){
sh """
sed -i "s#MEGAChatTest#${env.USER_AGENT_TESTS}#g" tests/sdk_test/sdk_test.h
sed -i "s#MEGAChatTest#${env.USER_AGENT_TESTS_MEGACHAT}#g" tests/sdk_test/sdk_test.h
"""
sh "echo Building SDK"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DUSE_WEBRTC=OFF -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
Expand Down Expand Up @@ -71,12 +71,12 @@ pipeline {
ulimit -c unlimited
if [ -z \"${TESTS_PARALLEL}\" ]; then
# Sequential run
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} &
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS_MEGACHAT} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} &
pid=\$!
wait \$pid || FAILED=1
else
# Parallel run
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} ${TESTS_PARALLEL} 2>&1 | tee tests.stdout
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS_MEGACHAT} --APIURL:${APIURL_TO_TEST} ${GTEST_FILTER} ${GTEST_REPEAT} ${TESTS_PARALLEL} 2>&1 | tee tests.stdout
[ \"\${PIPESTATUS[0]}\" != \"0\" ] && FAILED=1
fi
Expand Down
6 changes: 3 additions & 3 deletions jenkinsfile/specific_branches/MEGAChat_linux.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pipeline {
steps{
dir(megachat_sources_workspace){
sh """
sed -i "s#MEGAChatTest#${env.USER_AGENT_TESTS}#g" tests/sdk_test/sdk_test.h
sed -i "s#MEGAChatTest#${env.USER_AGENT_TESTS_MEGACHAT}#g" tests/sdk_test/sdk_test.h
"""
sh "echo Building SDK"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
Expand Down Expand Up @@ -72,12 +72,12 @@ pipeline {
ulimit -c unlimited
if [ -z \"${TESTS_PARALLEL}\" ]; then
# Sequential run
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS} --APIURL:${APIURL_TO_TEST} &
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS_MEGACHAT} --APIURL:${APIURL_TO_TEST} &
pid=\$!
wait \$pid || FAILED=1
else
# Parallel run
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS} --APIURL:${APIURL_TO_TEST} ${TESTS_PARALLEL} 2>&1 | tee tests.stdout
tests/sdk_test/megachat_tests --USERAGENT:${env.USER_AGENT_TESTS_MEGACHAT} --APIURL:${APIURL_TO_TEST} ${TESTS_PARALLEL} 2>&1 | tee tests.stdout
[ \"\${PIPESTATUS[0]}\" != \"0\" ] && FAILED=1
fi
Expand Down
69 changes: 69 additions & 0 deletions jenkinsfile/specific_branches/MEGAChat_macos_develop.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
pipeline {
agent { label 'osx && arm64' }
options {
buildDiscarder(logRotator(numToKeepStr: '135', daysToKeepStr: '21'))
gitLabConnection('GitLabConnectionJenkins')
ansiColor('xterm')
}
environment {
PATH = "/usr/local/bin:${env.PATH}"
VCPKGPATH = "${env.HOME}/jenkins/vcpkg"
MEGAQTPATH= "${env.HOME}/Qt-build/5.15.13/5.15.13/arm64"
BUILD_TYPE= "Release"
APIURL_TO_TEST = "https://g.api.mega.co.nz/"
SDK_BRANCH = "develop"
MEGACHAT_BRANCH = "develop"
BUILD_OPTIONS = ' '
BUILD_DIR = "build_dir"
BUILD_DIR_X64 = "build_dir_x64"
}
stages {
stage('Checkout SDK and MEGAchat'){
steps {
checkout([
$class: 'GitSCM',
branches: [[name: "origin/${env.MEGACHAT_BRANCH}"]],
userRemoteConfigs: [[ url: "${env.GIT_URL_MEGACHAT}", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]],
])
dir('third-party/mega'){
sh "echo Cloning SDK branch ${SDK_BRANCH}"
checkout([
$class: 'GitSCM',
branches: [[name: "origin/${SDK_BRANCH}"]],
userRemoteConfigs: [[ url: "${env.GIT_URL_SDK}", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]],
])
}
script{
megachat_sources_workspace = WORKSPACE
}
}
}
stage('Build MEGAchat'){
steps{
dir(megachat_sources_workspace){
//Build for arm64
sh "echo Building for arm64 in ${BUILD_TYPE} mode"
sh "mkdir ${BUILD_DIR}"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
-S ${megachat_sources_workspace} -B ${megachat_sources_workspace}/${BUILD_DIR} -DCMAKE_PREFIX_PATH=${MEGAQTPATH} \
-DCMAKE_OSX_ARCHITECTURES=arm64 -DENABLE_CHATLIB_QTAPP=OFF -DENABLE_CHATLIB_TESTS=ON -DUSE_FFMPEG=OFF -DUSE_FREEIMAGE=OFF"
sh "cmake --build ${megachat_sources_workspace}/${BUILD_DIR} -j3"

//build for x64
sh "echo Building for x64-crosscompiling in ${BUILD_TYPE} mode"
sh "mkdir ${BUILD_DIR_X64}"
sh "cmake -DENABLE_CHATLIB_WERROR=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVCPKG_ROOT=${VCPKGPATH} ${BUILD_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_CHATLIB_QTAPP=OFF -DENABLE_CHATLIB_TESTS=ON -DUSE_FFMPEG=OFF -DUSE_FREEIMAGE=OFF \
-S ${megachat_sources_workspace} -B ${megachat_sources_workspace}/${BUILD_DIR_X64} -DCMAKE_PREFIX_PATH=${MEGAQTPATH}"
sh "cmake --build ${megachat_sources_workspace}/${BUILD_DIR_X64} -j3"
}
}
}
}
post {
always {
deleteDir()
}
}
}
// vim: syntax=groovy tabstop=4 shiftwidth=4
Loading

0 comments on commit dcfb0db

Please sign in to comment.