Skip to content
Snippets Groups Projects
Sébastien Blin's avatar
Sébastien Blin authored
Because swarm is a synched history compatible with multi-devices,
if a message from the swarm is read on one device it should be
synchronized with other devices as much as possible.
The idea of this patch is to add lastDisplayed sent in synched
datas to allow clients to update the read status. However, there
is several scenarios to take into account, because the history
can be partially synched across devices.

5 scenarios are supported:
+ if the last displayed sent by other devices is the same as the
current one, there is nothing to do.
+ if there is no last displayed for the current device, the remote
displayed message is used.
+ if the remote last displayed is not present in the repo, it means
that the commit will be fetched later, so cache the result
+ if the remote is already fetched, we check that the local last
displayed is before in the history to replace it
+ Finally if a message is announced from the same author, it means
that we need to update the last displayed.

If the last displayed message is updated, AccountMessageStatusChanged
is triggered for the client.

Doc: https://git.jami.net/savoirfairelinux/jami-project/-/wikis/technical/2.3.%20Swarm
Change-Id: Iedd29129d72cbeb43499471bdfd492dd4d49dcb6
84c7c9de
History
COPYRIGHT NOTICE

Copyright (C) 2004-2022 Savoir-faire Linux Inc.

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 <http://www.gnu.org/licenses/>.


Introduction
------------

GNU Jami is a Voice-over-IP software phone. We want it to be:
- user friendly (fast, sleek, easy to learn interface)
- professional grade (transfers, holds, optimal audio quality)
- compatible with Asterisk (using SIP account)
- decentralized call (P2P-DHT)
- customizable

As the SIP/audio daemon and the user interface are separate processes,
it is easy to provide different user interfaces. GNU Jami comes with
various graphical user interfaces and even scripts to control the daemon from
the shell.

GNU Jami is currently used by the support team of Savoir-faire Linux Inc.

More information is available on the project homepage:
  https://www.jami.net/

This source tree contains the daemon application only that handles
the business logic of GNU Jami. UIs are located in differents repositories. See
the Contributing section for more information.


Short description of content of source tree
-------------------------------------------

- src/ is the core of DRing.
- bin/ contains applications main code.
- bin/dbus, the D-Bus XML interfaces, and C++ bindings

About Savoir-faire Linux
------------------------

Savoir-faire Linux is a consulting company based in Montreal, Quebec.
For more information, please check out our website:
https://www.savoirfairelinux.com/


How to compile on Linux
-----------------------

1) Compile the dependencies first

cd contrib
mkdir native
cd native
../bootstrap
make

2) Then the jamid application

cd ../../
mkdir build
export PATH=$PATH:`pwd`/contrib/`cc -dumpmachine`/bin
meson -Dpkg_config_path=`pwd`/contrib/`cc -dumpmachine`/lib/pkgconfig -Ddefault_library=static -Dinterfaces=dbus build
cd build
ninja
ninja install

Done !

Note:
If you don't want SHM to be used, you can build with `--without-dbus`

How to compile on Linux for Android
-----------------------------------

1) Download and install Android NDK
2) Compile the dependencies

export ANDROID_NDK=<NDK>
export ANDROID_ABI=arm64-v8a
export ANDROID_API=29
export TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
export TARGET=aarch64-linux-android
export CC=$TOOLCHAIN/bin/$TARGET$ANDROID_API-clang
export CXX=$TOOLCHAIN/bin/$TARGET$ANDROID_API-clang++
export AR=$TOOLCHAIN/bin/$TARGET-ar
export LD=$TOOLCHAIN/bin/$TARGET-ld
export RANLIB=$TOOLCHAIN/bin/$TARGET-ranlib
export STRIP=$TOOLCHAIN/bin/$TARGET-strip
export PATH=$PATH:$TOOLCHAIN/bin
cd contrib
mkdir native
cd native
../bootstrap --build=x86_64-pc-linux-gnu --host=$TARGET$ANDROID_API
make

3) Update directories in the file /cross-files/android_arm64_api29.txt
4) Compile the library libjami.so

cd ../../
mkdir build
meson --cross-file `pwd`/cross-files/android_arm64_api29.txt build
cd build
ninja
ninja install

Note: to build the tests add `-Dtests=true` ; or it can be enabled later with `meson --reconfigure -Dtests=true build`

How to compile on OSX
---------------------

# These first steps are only necessary if you don't use a package manager.
cd extras/tools
./bootstrap
make
export PATH=$PATH:/location/of/ring/daemon/extras/tools/build/bin

# Or, use your favorite package manager to install the necessary tools
(macports or brew).
automake, pkg-config, libtool, gettext, yasm

# Compile the dependencies
cd contrib
mkdir native
cd native
../bootstrap
make -j

# Then the daemon
cd ../../
./autogen.sh
./configure  --without-dbus --prefix=<install_path>
make

If you want to link against libringclient and native client easiest way is to
add to ./configure: --prefix=<prefix_path>

Do a little dance!


Common Issues
-------------

autopoint not found: When using Homebrew, autopoint is not found even when
gettext is installed, because symlinks are not created.
Run: 'brew link --force gettext' to fix it.


Clang compatibility (developers only)
-------------------------------------

It is possible to compile jamid with Clang by setting CC and CXX variables
to 'clang' and 'clang++' respectively when calling ./configure.

Currently it is not possible to use the DBus interface mechanism, and the
interaction between daemon and client will not work; for each platform where
D-Bus is not available the client should implement all the methods in the
*_stub.cpp files.


SIP accounts
---------------------

You may register an existing SIP account through the account wizard in both
clients (KDE and GNOME).
By doing this, you will be able to call other accounts known to this server.


Contributing to GNU Jami
------------------------

Of course we love patches. And contributions. And spring rolls.

Development website / Bug Tracker:
 - https://git.jami.net/savoirfairelinux/ring-project

Repositories are hosted on Gerrit, which we use for code review. It also
contains the client subprojects:
 - https://review.jami.net/#/admin/projects/

Do not hesitate to join us and post comments, suggestions, questions
and general feedback on the GNU Jami mailing-list:
https://lists.gnu.org/mailman/listinfo/jami