Go to file
jolavillette 24b6ef5d1b Distant chat: closing a conversation left its contact behind, and always said it worked
closeDistantChatConnexion() closes the GXS tunnel and stops there, on a comment
wondering whether the contact should go too ("also remove contact. Or do we
wait for the notification?"). It should: the entry in mDistantChatContacts is
the core's record of an open conversation -- handleOutgoingItem() accepts
outgoing items for as long as it is there -- and markDistantChatAsClosed(),
the remote-close path, removes it. Nothing removed it when we closed the
conversation ourselves, and the web UI showed it: a conversation left with
"Leave Chat" kept coming back.

The return value was the constant true, so every caller -- the chat window, the
web UI, any JSON API client -- was told the conversation had been closed even
when there was nothing to close: closeExistingTunnel() answers false and logs
"Cannot close distant tunnel connection. No connection openned for tunnel id"
once p3GxsTunnelService has pruned a remotely-closed tunnel, which it does on
its own ~20s after the close arrives. And the chat-level item that would have
removed the contact on the remote-close path lost its sender in 2015
(c521e4ed1), so a still-registered contact with no tunnel behind it is the
normal state of a conversation whose peer has left. The function now answers
whether anything was actually released -- tunnel, contact, or both -- and logs
an error in the one inconsistent case, a closed tunnel with no registered
contact.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 07:33:42 +02:00
.github/workflows ci(windows): drop the launcher, turn broadcast discovery off instead 2026-08-15 12:14:31 +02:00
.reuse Fix G10h4ck copyright attribution treewide 2026-06-14 12:13:43 +02:00
gradle/wrapper More work to ship libretroshare as standalone lib 2022-01-10 15:40:22 +01:00
LICENSES Improve license according to REUSE 3.0 2019-12-18 17:57:20 +01:00
misc/Android Fix G10h4ck copyright attribution treewide 2026-06-14 12:13:43 +02:00
src Distant chat: closing a conversation left its contact behind, and always said it worked 2026-09-03 07:33:42 +02:00
tests Fix G10h4ck copyright attribution treewide 2026-06-14 12:13:43 +02:00
.gitattributes More work to ship libretroshare as standalone lib 2022-01-10 15:40:22 +01:00
.gitignore libretroshare: implement RsGxsWikiEvent and clean dummy code 2026-01-03 15:31:49 +00:00
.gitlab-ci.yml Fix Android build for ndk r29 on ubuntu 26.04 2026-06-14 11:44:03 +02:00
build.gradle Fix Android build for ndk r29 on ubuntu 26.04 2026-06-14 11:44:03 +02:00
CMakeLists.txt build(cmake): add options to build the GXS Wiki and The Wire services 2026-08-03 12:20:53 +02:00
COPYING Add COPYING 2020-04-01 16:35:22 +02:00
gradlew More work to ship libretroshare as standalone lib 2022-01-10 15:40:22 +01:00
gradlew.bat More work to ship libretroshare as standalone lib 2022-01-10 15:40:22 +01:00
README.asciidoc Fix README typo 2026-06-14 12:54:05 +02:00
settings.gradle More work to ship libretroshare as standalone lib 2022-01-10 15:40:22 +01:00

// SPDX-FileCopyrightText: 2022 Retroshare Team <contact@retroshare.cc>
// SPDX-FileCopyrightText: 2022-2026 Gioacchino Mazzurco <gio@retroshare.cc>
// SPDX-License-Identifier: CC-BY-SA-4.0

== RetroShare library

RetroShare is a decentralized, private, secure, cross-platform, communication
software.

RetroShare functionalities (file sharing, chat, messages, forums, channels...)
are implemented under the hood by libretroshare which offers a documented C++ and
JSON API.

While RetroShare is an application on its own, libretroshare is meant to be
used as part of other programs, some of them are
https://retroshare.cc[RetroShare-gui],
https://retroshare.cc[RetroShare-service],
https://gitlab.com/elRepo.io/elRepo.io-android[elRepo.io]
(let us know if there are more).


=== Continuous integration

image:https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/libretroshare/-/commits/master",title="pipeline status"]

=== Developer Documentation

All public API methods are documented with Doxygen comments, so the most updated
way to read documentation is reading those comments in `src/retroshare/`.

To use libretroshare as part of your Android application we suggest to add our
maven repository, and then specify the variant and version that fits your needs
as dependency. RetroShare is then exposed as an Android Service as you can see
at https://gitlab.com/RetroShare/libretroshare/-/blob/master/src/rs_android/org/retroshare/service/RetroShareServiceAndroid.java?ref_type=heads[RetroShareServiceAndroid.java] start it and then interact with it
via RetroShare JSON API.

.Example of adding libretroshare as dependency in Gradle
--------------------------------------------------------------------------------
repositories {
	maven {
		url "https://gitlab.com/api/v4/projects/32730908/packages/maven"
	}
}

dependencies {
	// Look at https://gitlab.com/RetroShare/libretroshare/-/packages for
	// available options.
	//                 Minimum Android platform supported goes here ⬇
	//                                            Build variant goes here ⬇
	//                                                          Version goes here ⬇
	implementation "org.retroshare.service:libretroshare-MinApiLevel21-release:72f8b7e8"
}
--------------------------------------------------------------------------------


{empty} +

image:https://deepwiki.com/badge.svg[link="https://deepwiki.com/RetroShare/libretroshare",title="Ask DeepWiki"]