Compare commits
76 Commits
Author | SHA1 | Date | |
---|---|---|---|
a04693e39d | |||
3cce057545 | |||
9a44ae1fa5 | |||
85ff6c25ba | |||
3cc7db8eff | |||
|
ff9a591d6d | ||
8e3f10caff | |||
8bfe88929f | |||
9927bdc38b | |||
|
8083859541 | ||
|
030c374139 | ||
|
2c61b82924 | ||
fb843a1346 | |||
8d82d340a4 | |||
acd60eaba2 | |||
829777935f | |||
0be2648849 | |||
93c5be412e | |||
8f5325b291 | |||
75554c7451 | |||
00af582287 | |||
19835af3cf | |||
e31ef78e71 | |||
be466fbad1 | |||
0a530bfa93 | |||
637eb702a8 | |||
a7d1a28f29 | |||
297e08ba41 | |||
9d688e8596 | |||
23ec80ccba | |||
5fbb03fc46 | |||
81cf0f8d34 | |||
69d797fe51 | |||
4f295fee3c | |||
fffef9876a | |||
283e9ebc4d | |||
21b40a9ccb | |||
76a9c5da0c | |||
8ec0af3205 | |||
4b68da458f | |||
927bdf0dab | |||
5ba97ecc25 | |||
9fff409630 | |||
99fd001292 | |||
2d8f32c257 | |||
77dd28b600 | |||
6f32e99593 | |||
ec362cef55 | |||
e4a2728ef8 | |||
bf11d8a74e | |||
edf1ee60cd | |||
4af16b75bf | |||
bb304ce774 | |||
3c6b611a41 | |||
73d83f55af | |||
b72a837754 | |||
d4bf7e599a | |||
15fb4bbd62 | |||
2aed8a1209 | |||
78ef3664f7 | |||
5aa0f4bca9 | |||
b45a73b723 | |||
758a9d95f3 | |||
dfe72ca36c | |||
db3bc358a7 | |||
0b61b6e928 | |||
820dc845ea | |||
87973b3b67 | |||
b6ba022bff | |||
7b2b7ee5d5 | |||
c50cd1140e | |||
037dabbe06 | |||
2ae75a4b91 | |||
d162494ec8 | |||
7e9eed2075 | |||
7192286aeb |
45
.gitea/workflows/release.yml
Normal file
45
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,45 @@
|
||||
name: Squawk Release workflow
|
||||
run-name: ${{ gitea.actor }} is running Squawk Release workflow on release ${{ gitea.event.release.tag_name }}
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
Archlinux:
|
||||
runs-on: archlinux
|
||||
steps:
|
||||
- name: Download the release tarball
|
||||
run: curl -sL ${{ gitea.server_url }}/${{ gitea.repository }}/archive/${{ gitea.event.release.tag_name }}.tar.gz --output tarball.tar.gz
|
||||
|
||||
- name: Calculate SHA256 for the tarball
|
||||
run: echo "tbSum=$(sha256sum tarball.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_ENV
|
||||
|
||||
- name: Unarchive tarball
|
||||
run: tar -xvzf tarball.tar.gz
|
||||
|
||||
- name: Clone the AUR repository
|
||||
run: |
|
||||
echo "${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}" > key
|
||||
chmod 600 key
|
||||
GIT_SSH_COMMAND="ssh -i key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git clone ssh://aur@aur.archlinux.org/squawk.git aur
|
||||
chmod 777 -R aur
|
||||
cd aur
|
||||
git config user.name ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
|
||||
git config user.email ${{ secrets.DEPLOY_TO_AUR_EMAIL }}
|
||||
|
||||
|
||||
- name: Copy PKGBUILD to the directory
|
||||
run: cp squawk/packaging/Archlinux/PKGBUILD aur/
|
||||
|
||||
- name: Put SHA256 sum to PKGBUILD file, and generate .SRCINFO
|
||||
working-directory: aur
|
||||
run: |
|
||||
sed -i "/sha256sums=/c\sha256sums=('${{ env.tbSum }}')" PKGBUILD
|
||||
sudo -u build makepkg --printsrcinfo > .SRCINFO
|
||||
|
||||
- name: Commit package to aur
|
||||
working-directory: aur
|
||||
run: |
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m "${{ gitea.event.release.body//\"/\\\" }}"
|
||||
GIT_SSH_COMMAND="ssh -i ../key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git push
|
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,3 +1,9 @@
|
||||
[submodule "external/qxmpp"]
|
||||
path = external/qxmpp
|
||||
url = https://github.com/qxmpp-project/qxmpp.git
|
||||
[submodule "external/storage"]
|
||||
path = external/storage
|
||||
url = https://git.macaw.me/blue/storage
|
||||
[submodule "external/lmdbal"]
|
||||
path = external/lmdbal
|
||||
url = gitea@git.macaw.me:blue/lmdbal.git
|
||||
|
3640
.uncrustify.cfg
Normal file
3640
.uncrustify.cfg
Normal file
File diff suppressed because it is too large
Load Diff
27
CHANGELOG.md
27
CHANGELOG.md
@ -1,9 +1,28 @@
|
||||
# Changelog
|
||||
|
||||
## Squawk 0.2.3 (February 04, 2024)
|
||||
### Bug fixes
|
||||
- "Add contact" and "Join conference" menu are enabled once again (pavavno)!
|
||||
- availability is now read from the same section of config file it was stored
|
||||
- automatic avatars (if a contact doesn't have one) get generated once again
|
||||
|
||||
### Improvements
|
||||
- deactivated accounts now don't appear in combobox of "Add contact" and "Join conference" dialogues
|
||||
- all of the expandable roster items now get saved between launches
|
||||
- settings file on the disk is not rewritten every roster element expansion or collapse
|
||||
- removed unnecessary own vcard request at sturtup (used to do it to discover my own avatar)
|
||||
- vcard window now is Info system and it can display more information
|
||||
- reduced vcard request spam in MUCs
|
||||
|
||||
### New features
|
||||
- now you can enable tray icon from settings!
|
||||
- there is a job queue now, this allowes to spread a bit the spam on the server at connection time
|
||||
- squawk now queries clients of it's peers, you can see what programs other people use
|
||||
|
||||
## Squawk 0.2.2 (May 05, 2022)
|
||||
### Bug fixes
|
||||
- now when you remove an account it actually gets removed
|
||||
- segfault on unitialized Availability in some rare occesions
|
||||
- segfault on uninitialized Availability in some rare occasions
|
||||
- fixed crash when you open a dialog with someone that has only error messages in archive
|
||||
- message height is now calculated correctly on Chinese and Japanese paragraphs
|
||||
- the app doesn't crash on SIGINT anymore
|
||||
@ -12,13 +31,13 @@
|
||||
- there is a way to disable an account and it wouldn't connect when you change availability
|
||||
- if you cancel password query an account becomes inactive and doesn't annoy you anymore
|
||||
- if you filled password field and chose KWallet as a storage Squawk wouldn't ask you again for the same password
|
||||
- if left the password field empty and chose KWallet as a storage Squawk will try to get that passord from KWallet before asking you to input it
|
||||
- accounts now connect to the server asyncronously - if one is stopped on password prompt another is connecting
|
||||
- if left the password field empty and chose KWallet as a storage Squawk will try to get that password from KWallet before asking you to input it
|
||||
- accounts now connect to the server asynchronously - if one is stopped on password prompt another is connecting
|
||||
- actualized translations, added English localization file
|
||||
|
||||
### New features
|
||||
- new "About" window with links, license, gratitudes
|
||||
- if the authentication failed Squawk will ask againg for your password and login
|
||||
- if the authentication failed Squawk will ask again for your password and login
|
||||
- now there is an amount of unread messages showing on top of Squawk launcher icon
|
||||
- notifications now have buttons to open a conversation or to mark that message as read
|
||||
|
||||
|
152
CMakeLists.txt
152
CMakeLists.txt
@ -1,10 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
project(squawk VERSION 0.2.2 LANGUAGES CXX)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(squawk VERSION 0.2.3 LANGUAGES CXX)
|
||||
|
||||
cmake_policy(SET CMP0076 NEW)
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
cmake_policy(SET CMP0079 NEW)
|
||||
cmake_policy(SET CMP0167 NEW)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(QT_VERSION_MAJOR 5)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
@ -27,44 +30,43 @@ add_executable(squawk ${WIN32_FLAG} ${MACOSX_BUNDLE_FLAG})
|
||||
target_include_directories(squawk PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
|
||||
option(SYSTEM_QXMPP "Use system qxmpp lib" ON)
|
||||
option(SYSTEM_LMDBAL "Use system lmdbal lib" ON)
|
||||
option(WITH_KWALLET "Build KWallet support module" ON)
|
||||
option(WITH_KIO "Build KIO support module" ON)
|
||||
option(WITH_KCONFIG "Build KConfig support module" ON)
|
||||
option(WITH_OMEMO "Build OMEMO support module" OFF) #it should be off by default untill I sort the problems out
|
||||
option(WITH_SIMPLE_CRYPT "Builds with SimpleCrypt to obfuscate password" ON)
|
||||
|
||||
# Dependencies
|
||||
## Qt
|
||||
set(QT_VERSION_MAJOR 5)
|
||||
find_package(Qt5 COMPONENTS Widgets DBus Gui Xml Network Core REQUIRED)
|
||||
if (NOT DEFINED QT_VERSION_MAJOR)
|
||||
find_package(QT NAMES Qt6 Qt5 CONFIG REQUIRED COMPONENTS Widgets DBus Gui Xml Network Core)
|
||||
else ()
|
||||
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED COMPONENTS Widgets DBus Gui Xml Network Core)
|
||||
endif()
|
||||
|
||||
find_package(Boost COMPONENTS)
|
||||
|
||||
target_include_directories(squawk PRIVATE ${Boost_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5Widgets_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5DBus_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5Gui_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5Xml_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5Network_INCLUDE_DIRS})
|
||||
target_include_directories(squawk PRIVATE ${Qt5Core_INCLUDE_DIRS})
|
||||
|
||||
## QXmpp
|
||||
if (SYSTEM_QXMPP)
|
||||
find_package(QXmpp CONFIG)
|
||||
|
||||
if (NOT QXmpp_FOUND)
|
||||
set(SYSTEM_QXMPP OFF)
|
||||
message("QXmpp package wasn't found, trying to build with bundled QXmpp")
|
||||
## OMEMO
|
||||
if (WITH_OMEMO)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(OMEMO libomemo-c)
|
||||
if (OMEMO_FOUND)
|
||||
target_compile_definitions(squawk PRIVATE WITH_OMEMO)
|
||||
message("Building with support of OMEMO")
|
||||
else ()
|
||||
message("libomemo-c package wasn't found, trying to build without OMEMO support")
|
||||
set(WITH_OMEMO OFF)
|
||||
endif ()
|
||||
else ()
|
||||
message("Building with system QXmpp")
|
||||
message("PKG_CONFIG module wasn't found, can not check libomemo-c support, trying to build without OMEMO support")
|
||||
set(WITH_OMEMO OFF)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT SYSTEM_QXMPP)
|
||||
target_link_libraries(squawk PRIVATE qxmpp)
|
||||
add_subdirectory(external/qxmpp)
|
||||
else ()
|
||||
target_link_libraries(squawk PRIVATE QXmpp::QXmpp)
|
||||
endif ()
|
||||
|
||||
## KIO
|
||||
if (WITH_KIO)
|
||||
find_package(KF5KIO CONFIG)
|
||||
@ -91,6 +93,7 @@ if (WITH_KWALLET)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
## KConfig
|
||||
if (WITH_KCONFIG)
|
||||
find_package(KF5Config CONFIG)
|
||||
if (NOT KF5Config_FOUND)
|
||||
@ -109,24 +112,91 @@ if (WITH_KCONFIG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## Signal (TODO)
|
||||
# find_package(Signal REQUIRED)
|
||||
## QXmpp
|
||||
if (SYSTEM_QXMPP)
|
||||
if (WITH_OMEMO)
|
||||
find_package(QXmpp CONFIG COMPONENTS Omemo)
|
||||
else ()
|
||||
find_package(QXmpp CONFIG)
|
||||
endif ()
|
||||
|
||||
## LMDB
|
||||
find_package(LMDB REQUIRED)
|
||||
if (NOT QXmpp_FOUND)
|
||||
set(SYSTEM_QXMPP OFF)
|
||||
message("QXmpp package wasn't found, trying to build with bundled QXmpp")
|
||||
else ()
|
||||
message("Building with system QXmpp")
|
||||
endif ()
|
||||
endif () #it's endif() + if() and not else() because I want it to have a fallback behaviour
|
||||
if (NOT SYSTEM_QXMPP) #we can fail finding system QXmpp and this way we'll check bundled before failing completely
|
||||
message("Building with bundled QXmpp")
|
||||
|
||||
# Linking
|
||||
target_link_libraries(squawk PRIVATE Qt5::Core Qt5::Widgets Qt5::DBus Qt5::Network Qt5::Gui Qt5::Xml)
|
||||
target_link_libraries(squawk PRIVATE lmdb)
|
||||
target_link_libraries(squawk PRIVATE simpleCrypt)
|
||||
# Link thread libraries on Linux
|
||||
target_include_directories(squawk PRIVATE ${CMAKE_SOURCE_DIR}/external/qxmpp/src/base)
|
||||
target_include_directories(squawk PRIVATE ${CMAKE_SOURCE_DIR}/external/qxmpp/src/client)
|
||||
target_include_directories(squawk PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/external/qxmpp/src)
|
||||
|
||||
if (WITH_OMEMO)
|
||||
target_include_directories(squawk PRIVATE ${CMAKE_SOURCE_DIR}/external/qxmpp/src/omemo)
|
||||
target_include_directories(squawk PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/external/qxmpp/src/omemo)
|
||||
set(BUILD_OMEMO ON)
|
||||
set(BUILD_TESTS OFF)
|
||||
else ()
|
||||
set(BUILD_OMEMO OFF)
|
||||
endif ()
|
||||
add_subdirectory(external/qxmpp)
|
||||
add_library(QXmpp::QXmpp ALIAS QXmppQt${QT_VERSION_MAJOR})
|
||||
if (WITH_OMEMO)
|
||||
target_include_directories(QXmppOmemoQt${QT_VERSION_MAJOR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/external/qxmpp/src)
|
||||
add_library(QXmpp::Omemo ALIAS QXmppOmemoQt${QT_VERSION_MAJOR})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
## LMDBAL
|
||||
if (SYSTEM_LMDBAL)
|
||||
find_package(lmdbal)
|
||||
if (NOT lmdbal_FOUND)
|
||||
set(SYSTEM_LMDBAL OFF)
|
||||
message("LMDBAL package wasn't found, trying to build with bundled LMDBAL")
|
||||
else ()
|
||||
message("Building with system LMDBAL")
|
||||
endif ()
|
||||
else()
|
||||
message("Building with bundled LMDBAL")
|
||||
set(BUILD_STATIC ON)
|
||||
add_subdirectory(external/lmdbal)
|
||||
add_library(LMDBAL::LMDBAL ALIAS LMDBAL)
|
||||
endif()
|
||||
|
||||
## Linking
|
||||
target_link_libraries(squawk
|
||||
PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::DBus
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Xml
|
||||
LMDBAL::LMDBAL
|
||||
QXmpp::QXmpp
|
||||
)
|
||||
|
||||
if (WITH_OMEMO)
|
||||
target_link_libraries(squawk PRIVATE QXmpp::Omemo)
|
||||
endif ()
|
||||
|
||||
if (WITH_SIMPLE_CRYPT)
|
||||
target_compile_definitions(squawk PRIVATE WITH_SIMPLE_CRYPT)
|
||||
add_subdirectory(external/simpleCrypt)
|
||||
target_link_libraries(squawk PRIVATE simpleCrypt)
|
||||
endif ()
|
||||
|
||||
## Link thread libraries on Linux
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(squawk PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
# Build type
|
||||
## Build type
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
endif ()
|
||||
@ -148,9 +218,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
target_compile_options(squawk PRIVATE ${COMPILE_OPTIONS})
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# I am not really sure about this solution
|
||||
# This should enable plugins to be found in path like /usr/lib/squawk instead of just /usr/lib
|
||||
set(PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/squawk")
|
||||
add_compile_definitions(PLUGIN_PATH="${PLUGIN_PATH}")
|
||||
|
||||
add_subdirectory(main)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(external/simpleCrypt)
|
||||
add_subdirectory(packaging)
|
||||
add_subdirectory(plugins)
|
||||
add_subdirectory(resources)
|
||||
@ -158,7 +232,7 @@ add_subdirectory(shared)
|
||||
add_subdirectory(translations)
|
||||
add_subdirectory(ui)
|
||||
|
||||
# Install the executable
|
||||
## Install the executable
|
||||
install(TARGETS squawk DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES README.md DESTINATION ${CMAKE_INSTALL_DATADIR}/macaw.me/squawk)
|
||||
install(FILES LICENSE.md DESTINATION ${CMAKE_INSTALL_DATADIR}/macaw.me/squawk)
|
||||
@ -166,7 +240,7 @@ install(FILES LICENSE.md DESTINATION ${CMAKE_INSTALL_DATADIR}/macaw.me/squawk)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
if (APPLE)
|
||||
add_custom_command(TARGET squawk POST_BUILD COMMENT "Running macdeployqt..."
|
||||
COMMAND "${Qt5Widgets_DIR}/../../../bin/macdeployqt" "${CMAKE_CURRENT_BINARY_DIR}/squawk.app"
|
||||
COMMAND "${Qt${QT_VERSION_MAJOR}Widgets_DIR}/../../../bin/macdeployqt" "${CMAKE_CURRENT_BINARY_DIR}/squawk.app"
|
||||
)
|
||||
endif(APPLE)
|
||||
endif()
|
||||
|
75
README.md
75
README.md
@ -4,14 +4,14 @@
|
||||
[![AUR version](https://img.shields.io/aur/version/squawk?style=flat-square)](https://aur.archlinux.org/packages/squawk/)
|
||||
[![Liberapay patrons](https://img.shields.io/liberapay/patrons/macaw.me?logo=liberapay&style=flat-square)](https://liberapay.com/macaw.me)
|
||||
|
||||
![Squawk screenshot](https://macaw.me/images/squawk/0.2.2.png)
|
||||
![Squawk screenshot](https://macaw.me/projects/squawk/0.2.2.png)
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- QT 5.12 *(lower versions might work but it wasn't tested)*
|
||||
- lmdb
|
||||
- CMake 3.4 or higher
|
||||
- qxmpp 1.1.0 or higher
|
||||
- LMDBAL (my own [library](https://git.macaw.me/blue/lmdbal) for lmdb)
|
||||
- KDE Frameworks: kwallet (optional)
|
||||
- KDE Frameworks: KIO (optional)
|
||||
- KDE Frameworks: KConfig (optional)
|
||||
@ -33,14 +33,49 @@ $ pacaur -S squawk
|
||||
|
||||
### Building
|
||||
|
||||
You can also clone the repo and build it from source
|
||||
You can also the repo and build it from source
|
||||
|
||||
Squawk requires Qt with SSL enabled. It uses CMake as build system.
|
||||
|
||||
Please check the prerequisites and install them before installation.
|
||||
|
||||
---
|
||||
|
||||
There are several ways to build Squawk. The one you need depends on whether you have `qxmpp` and `lmdbal` installed in your system.
|
||||
|
||||
#### Building with system dependencies
|
||||
|
||||
This is the easiest way but it requires you to have `qxmpp` and `lmdbal` installed as system packages. Here is what you do:
|
||||
|
||||
```
|
||||
$ git clone https://git.macaw.me/blue/squawk
|
||||
$ cd squawk
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
$ cmake --build .
|
||||
```
|
||||
|
||||
#### Building with bundled qxmpp
|
||||
|
||||
If you don't have any of `qxmpp` or `lmdbal` (or both) installed the process is abit mor complicated.
|
||||
On the configuration stage you need to enable one or both entries in the square brackets, depending on what package your system lacks.
|
||||
|
||||
Here is what you do
|
||||
|
||||
```
|
||||
$ git clone --recurse-submodules https://git.macaw.me/blue/squawk
|
||||
$ cd squawk
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. [-D SYSTEM_QXMPP=False] [-D SYSTEM_LMDBAL=False]
|
||||
$ cmake --build .
|
||||
```
|
||||
|
||||
#### For Windows (Mingw-w64) build
|
||||
|
||||
**Building for windows is not mainteined, but was possible in the past, you can try, but it probably won't work**
|
||||
|
||||
You need Qt for mingw64 (MinGW 64-bit) platform when installing Qt.
|
||||
|
||||
The best way to acquire library `lmdb` and `boost` is through Msys2.
|
||||
@ -49,52 +84,30 @@ First install Msys2, and then install `mingw-w64-x86_64-lmdb` and `mingw-w64-x86
|
||||
|
||||
Then you need to provide the cmake cache entry when calling cmake for configuration:
|
||||
|
||||
```
|
||||
cmake .. -D LMDB_ROOT_DIR:PATH=<Msys2 Mingw64 Root Directory> -D BOOST_ROOT:PATH=<Msys2 Mingw64 Root Directory>
|
||||
```
|
||||
|
||||
`<Msys2 Mingw64 Root Directory>`: e.g. `C:/msys64/mingw64`.
|
||||
|
||||
---
|
||||
|
||||
There are two ways to build, it depends whether you have qxmpp installed in your system
|
||||
|
||||
#### Building with system qxmpp
|
||||
|
||||
Here is what you do
|
||||
|
||||
```
|
||||
$ git clone https://git.macaw.me/blue/squawk
|
||||
$ cd squawk
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. [-D LMDB_ROOT_DIR:PATH=...] [-D BOOST_ROOT:PATH=...]
|
||||
$ cmake --build .
|
||||
```
|
||||
|
||||
#### Building with bundled qxmpp
|
||||
|
||||
Here is what you do
|
||||
|
||||
```
|
||||
$ git clone --recurse-submodules https://git.macaw.me/blue/squawk
|
||||
$ cd squawk
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake .. -D SYSTEM_QXMPP=False [-D LMDB_ROOT_DIR:PATH=...] [-D BOOST_ROOT:PATH=...]
|
||||
$ cmake .. -D SYSTEM_QXMPP=False -D SYSTEM_LMDBAL=False -D LMDB_ROOT_DIR:PATH=<Msys2 Mingw64 Root Directory> -D BOOST_ROOT:PATH=<Msys2 Mingw64 Root Directory>
|
||||
$ cmake --build .
|
||||
```
|
||||
|
||||
You can always refer to `appveyor.yml` to see how AppVeyor build squawk.
|
||||
You can always refer to `appveyor.yml` to see how AppVeyor build squawk for windows.
|
||||
|
||||
### List of keys
|
||||
|
||||
Here is the list of keys you can pass to configuration phase of `cmake ..`.
|
||||
Here is the list of keys you can pass to configuration phase of `cmake ..`:
|
||||
|
||||
- `CMAKE_BUILD_TYPE` - `Debug` just builds showing all warnings, `Release` builds with no warnings and applies optimizations (default is `Debug`)
|
||||
- `SYSTEM_QXMPP` - `True` tries to link against `qxmpp` installed in the system, `False` builds bundled `qxmpp` library (default is `True`)
|
||||
- `SYSTEM_LMDBAL` - `True` tries to link against `LMDABL` installed in the system, `False` builds bundled `LMDBAL` library (default is `True`)
|
||||
- `WITH_KWALLET` - `True` builds the `KWallet` capability module if `KWallet` is installed and if not goes to `False`. `False` disables `KWallet` support (default is `True`)
|
||||
- `WITH_KIO` - `True` builds the `KIO` capability module if `KIO` is installed and if not goes to `False`. `False` disables `KIO` support (default is `True`)
|
||||
- `WITH_KCONFIG` - `True` builds the `KConfig` and `KConfigWidgets` capability module if such packages are installed and if not goes to `False`. `False` disables `KConfig` and `KConfigWidgets` support (default is `True`)
|
||||
- `WITH_OMEMO` - `True` builds the OMEMO encryption, requires `qxmpp` of version >= 1.5.0 built with OMEMO support. `False` disables OMEMO support (default is `False`)
|
||||
|
||||
## License
|
||||
|
||||
|
@ -1,52 +0,0 @@
|
||||
#This file is taken from here https://gitlab.ralph.or.at/causal-rt/causal-cpp/, it was GPLv3 license
|
||||
#Thank you so much, mr. Ralph Alexander Bariz, I hope you don't mind me using your code
|
||||
|
||||
# Try to find LMDB headers and library.
|
||||
#
|
||||
# Usage of this module as follows:
|
||||
#
|
||||
# find_package(LMDB)
|
||||
#
|
||||
# Variables used by this module, they can change the default behaviour and need
|
||||
# to be set before calling find_package:
|
||||
#
|
||||
# LMDB_ROOT_DIR Set this variable to the root installation of
|
||||
# LMDB if the module has problems finding the
|
||||
# proper installation path.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
# LMDB_FOUND System has LMDB library/headers.
|
||||
# LMDB_LIBRARIES The LMDB library.
|
||||
# LMDB_INCLUDE_DIRS The location of LMDB headers.
|
||||
|
||||
find_path(LMDB_ROOT_DIR
|
||||
NAMES include/lmdb.h
|
||||
)
|
||||
|
||||
find_library(LMDB_LIBRARIES
|
||||
NAMES liblmdb.a liblmdb.so liblmdb.so.a liblmdb.dll.a # We want lmdb to be static, if possible
|
||||
HINTS ${LMDB_ROOT_DIR}/lib
|
||||
)
|
||||
|
||||
add_library(lmdb UNKNOWN IMPORTED)
|
||||
set_target_properties(lmdb PROPERTIES
|
||||
IMPORTED_LOCATION ${LMDB_LIBRARIES}
|
||||
)
|
||||
|
||||
find_path(LMDB_INCLUDE_DIRS
|
||||
NAMES lmdb.h
|
||||
HINTS ${LMDB_ROOT_DIR}/include
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LMDB DEFAULT_MSG
|
||||
LMDB_LIBRARIES
|
||||
LMDB_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
LMDB_ROOT_DIR
|
||||
LMDB_LIBRARIES
|
||||
LMDB_INCLUDE_DIRS
|
||||
)
|
@ -1,15 +0,0 @@
|
||||
find_path(Signal_INCLUDE_DIR NAMES signal/signal_protocol.h)
|
||||
find_library(Signal_LIBRARY signal-protocol-c)
|
||||
mark_as_advanced(Signal_INCLUDE_DIR Signal_LIBRARY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Signal REQUIRED_VARS Signal_LIBRARY Signal_INCLUDE_DIR)
|
||||
|
||||
if (Signal_FOUND AND NOT TARGET Signal::Signal)
|
||||
add_library(Signal::Signal UNKNOWN IMPORTED)
|
||||
set_target_properties(Signal::Signal PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${Signal_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Signal_INCLUDE_DIR}"
|
||||
)
|
||||
endif ()
|
@ -3,27 +3,34 @@ if(WIN32)
|
||||
set(SIGNALCATCHER_SOURCE signalcatcher_win32.cpp)
|
||||
endif(WIN32)
|
||||
|
||||
set(SOURCE_FILES
|
||||
account.cpp
|
||||
adapterfunctions.cpp
|
||||
conference.cpp
|
||||
contact.cpp
|
||||
rosteritem.cpp
|
||||
${SIGNALCATCHER_SOURCE}
|
||||
squawk.cpp
|
||||
)
|
||||
|
||||
set(HEADER_FILES
|
||||
account.h
|
||||
adapterfunctions.h
|
||||
conference.h
|
||||
contact.h
|
||||
rosteritem.h
|
||||
signalcatcher.h
|
||||
squawk.h
|
||||
)
|
||||
|
||||
target_sources(squawk PRIVATE
|
||||
account.cpp
|
||||
account.h
|
||||
adapterfunctions.cpp
|
||||
adapterfunctions.h
|
||||
conference.cpp
|
||||
conference.h
|
||||
contact.cpp
|
||||
contact.h
|
||||
networkaccess.cpp
|
||||
networkaccess.h
|
||||
rosteritem.cpp
|
||||
rosteritem.h
|
||||
${SIGNALCATCHER_SOURCE}
|
||||
signalcatcher.h
|
||||
squawk.cpp
|
||||
squawk.h
|
||||
)
|
||||
${SOURCE_FILES}
|
||||
${HEADER_FILES}
|
||||
)
|
||||
|
||||
target_include_directories(squawk PRIVATE ${LMDB_INCLUDE_DIRS})
|
||||
|
||||
add_subdirectory(handlers)
|
||||
add_subdirectory(storage)
|
||||
add_subdirectory(passwordStorageEngines)
|
||||
add_subdirectory(components)
|
||||
add_subdirectory(delayManager)
|
||||
|
425
core/account.cpp
425
core/account.cpp
@ -18,11 +18,20 @@
|
||||
|
||||
#include "account.h"
|
||||
#include <QXmppMessage.h>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
using namespace Core;
|
||||
#include "shared/defines.h"
|
||||
|
||||
Account::Account(const QString& p_login, const QString& p_server, const QString& p_password, const QString& p_name, bool p_active, NetworkAccess* p_net, QObject* parent):
|
||||
Core::Account::Account(
|
||||
const QString& p_login,
|
||||
const QString& p_server,
|
||||
const QString& p_password,
|
||||
const QString& p_name,
|
||||
bool p_active,
|
||||
NetworkAccess* p_net,
|
||||
QObject* parent
|
||||
):
|
||||
QObject(parent),
|
||||
name(p_name),
|
||||
archiveQueries(),
|
||||
@ -30,7 +39,25 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
||||
config(),
|
||||
presence(),
|
||||
state(Shared::ConnectionState::disconnected),
|
||||
|
||||
mh(new MessageHandler(this)),
|
||||
rh(new RosterHandler(this)),
|
||||
vh(new VCardHandler(this)),
|
||||
dh(new DiscoveryHandler(this)),
|
||||
#if (QXMPP_VERSION) >= QT_VERSION_CHECK(1, 5, 0)
|
||||
th(new TrustHandler(this)),
|
||||
#endif
|
||||
#ifdef WITH_OMEMO
|
||||
oh(new OmemoHandler(this)),
|
||||
om(new QXmppOmemoManager(oh)),
|
||||
#endif
|
||||
#if (QXMPP_VERSION) >= QT_VERSION_CHECK(1, 5, 0)
|
||||
tm(new QXmppTrustManager(th)),
|
||||
cm(new QXmppCarbonManagerV2()),
|
||||
psm(new QXmppPubSubManager()),
|
||||
#else
|
||||
cm(new QXmppCarbonManager()),
|
||||
#endif
|
||||
am(new QXmppMamManager()),
|
||||
mm(new QXmppMucManager()),
|
||||
bm(new QXmppBookmarkManager()),
|
||||
@ -42,20 +69,29 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
||||
reconnectScheduled(false),
|
||||
reconnectTimer(new QTimer),
|
||||
network(p_net),
|
||||
delay(nullptr),
|
||||
passwordType(Shared::AccountPassword::plain),
|
||||
lastError(Error::none),
|
||||
pepSupport(false),
|
||||
pepSupport(Shared::Support::unknown),
|
||||
active(p_active),
|
||||
notReadyPassword(false),
|
||||
mh(new MessageHandler(this)),
|
||||
rh(new RosterHandler(this)),
|
||||
vh(new VCardHandler(this))
|
||||
loadingOmemo(false)
|
||||
{
|
||||
config.setUser(p_login);
|
||||
config.setDomain(p_server);
|
||||
config.setPassword(p_password);
|
||||
config.setAutoAcceptSubscriptions(true);
|
||||
//config.setAutoReconnectionEnabled(false);
|
||||
delay = new DelayManager::Manager(getBareJid());
|
||||
QObject::connect(delay, &DelayManager::Manager::gotInfo, this, &Account::infoReady);
|
||||
QObject::connect(delay, &DelayManager::Manager::gotOwnInfo, this, &Account::infoReady);
|
||||
|
||||
QObject::connect(delay, &DelayManager::Manager::requestOwnVCard, vm, &QXmppVCardManager::requestClientVCard);
|
||||
QObject::connect(delay, &DelayManager::Manager::requestVCard, vm, &QXmppVCardManager::requestVCard);
|
||||
|
||||
rh->initialize();
|
||||
vh->initialize();
|
||||
dh->initialize();
|
||||
|
||||
QObject::connect(&client, &QXmppClient::stateChanged, this, &Account::onClientStateChange);
|
||||
QObject::connect(&client, &QXmppClient::presenceReceived, this, &Account::onPresenceReceived);
|
||||
@ -64,8 +100,10 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
||||
|
||||
client.addExtension(cm);
|
||||
|
||||
#if (QXMPP_VERSION) < QT_VERSION_CHECK(1, 5, 0)
|
||||
QObject::connect(cm, &QXmppCarbonManager::messageReceived, mh, &MessageHandler::onCarbonMessageReceived);
|
||||
QObject::connect(cm, &QXmppCarbonManager::messageSent, mh, &MessageHandler::onCarbonMessageSent);
|
||||
#endif
|
||||
|
||||
client.addExtension(am);
|
||||
|
||||
@ -79,15 +117,40 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
||||
QObject::connect(um, &QXmppUploadRequestManager::slotReceived, mh, &MessageHandler::onUploadSlotReceived);
|
||||
QObject::connect(um, &QXmppUploadRequestManager::requestFailed, mh, &MessageHandler::onUploadSlotRequestFailed);
|
||||
|
||||
QObject::connect(dm, &QXmppDiscoveryManager::itemsReceived, this, &Account::onDiscoveryItemsReceived);
|
||||
QObject::connect(dm, &QXmppDiscoveryManager::infoReceived, this, &Account::onDiscoveryInfoReceived);
|
||||
|
||||
QObject::connect(network, &NetworkAccess::uploadFileComplete, mh, &MessageHandler::onUploadFileComplete);
|
||||
QObject::connect(network, &NetworkAccess::downloadFileComplete, mh, &MessageHandler::onDownloadFileComplete);
|
||||
QObject::connect(network, &NetworkAccess::loadFileError, mh, &MessageHandler::onLoadFileError);
|
||||
|
||||
client.addExtension(rcpm);
|
||||
QObject::connect(rcpm, &QXmppMessageReceiptManager::messageDelivered, mh, &MessageHandler::onReceiptReceived);
|
||||
|
||||
client.addExtension(psm);
|
||||
|
||||
#ifdef WITH_OMEMO
|
||||
QObject::connect(delay, &DelayManager::Manager::requestBundles, oh, &OmemoHandler::requestBundles);
|
||||
QObject::connect(delay, &DelayManager::Manager::requestOwnBundles, oh, &OmemoHandler::requestOwnBundles);
|
||||
|
||||
QObject::connect(om, &QXmppOmemoManager::deviceAdded, oh, &OmemoHandler::onOmemoDeviceAdded);
|
||||
|
||||
client.addExtension(tm);
|
||||
client.addExtension(om);
|
||||
om->setSecurityPolicy(QXmpp::Toakafa);
|
||||
|
||||
if (oh->hasOwnDevice()) {
|
||||
QXmppTask<bool> future = om->load();
|
||||
loadingOmemo = true;
|
||||
future.then(this, [this] (bool result) {
|
||||
loadingOmemo = false;
|
||||
if (state == Shared::ConnectionState::scheduled)
|
||||
client.connectToServer(config, presence);
|
||||
|
||||
if (result)
|
||||
qDebug() << "successfully loaded OMEMO data for account" << getName();
|
||||
else
|
||||
qDebug() << "couldn't load OMEMO data for account" << getName();
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
reconnectTimer->setSingleShot(true);
|
||||
QObject::connect(reconnectTimer, &QTimer::timeout, this, &Account::onReconnectTimer);
|
||||
@ -97,14 +160,14 @@ Account::Account(const QString& p_login, const QString& p_server, const QString&
|
||||
logger->setLoggingType(QXmppLogger::SignalLogging);
|
||||
client.setLogger(logger);
|
||||
|
||||
QObject::connect(logger, &QXmppLogger::message, this, [](QXmppLogger::MessageType type, const QString& text){
|
||||
QObject::connect(logger, &QXmppLogger::message, this, [](QXmppLogger::MessageType type, const QString& text) {
|
||||
SHARED_UNUSED(type);
|
||||
qDebug() << text;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Account::~Account()
|
||||
{
|
||||
Core::Account::~Account() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
reconnectTimer->stop();
|
||||
@ -114,27 +177,40 @@ Account::~Account()
|
||||
QObject::disconnect(network, &NetworkAccess::downloadFileComplete, mh, &MessageHandler::onDownloadFileComplete);
|
||||
QObject::disconnect(network, &NetworkAccess::loadFileError, mh, &MessageHandler::onLoadFileError);
|
||||
|
||||
delete vh;
|
||||
delete mh;
|
||||
delete rh;
|
||||
|
||||
rh->clear(); //conferenses inside of roster handler hold QXmppMuc objects.
|
||||
//If we destroy QXmppMucManager, then when we will be destroying RosterHandler
|
||||
//it will try to destory Core::Conference objects
|
||||
//and inside of those QXmppMuc objects will already be destroyed.
|
||||
//So, clear will start the destruction from Core::Conference and this way it's not gonna crash
|
||||
|
||||
delete delay;
|
||||
delete reconnectTimer;
|
||||
delete rcpm;
|
||||
delete dm;
|
||||
delete um;
|
||||
delete bm;
|
||||
delete mm;
|
||||
delete am;
|
||||
delete cm;
|
||||
#if (QXMPP_VERSION) >= QT_VERSION_CHECK(1, 5, 0)
|
||||
delete psm;
|
||||
#endif
|
||||
#ifdef WITH_OMEMO
|
||||
delete om;
|
||||
delete tm;
|
||||
delete oh;
|
||||
delete th;
|
||||
#endif
|
||||
|
||||
delete dh;
|
||||
delete vh;
|
||||
delete rh;
|
||||
delete mh;
|
||||
}
|
||||
|
||||
Shared::ConnectionState Core::Account::getState() const
|
||||
{
|
||||
return state;
|
||||
}
|
||||
Shared::ConnectionState Core::Account::getState() const {
|
||||
return state;}
|
||||
|
||||
void Core::Account::connect()
|
||||
{
|
||||
void Core::Account::connect() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
reconnectTimer->stop();
|
||||
@ -143,7 +219,12 @@ void Core::Account::connect()
|
||||
if (notReadyPassword) {
|
||||
emit needPassword();
|
||||
} else {
|
||||
client.connectToServer(config, presence);
|
||||
if (loadingOmemo) {
|
||||
state = Shared::ConnectionState::scheduled;
|
||||
emit connectionStateChanged(state);
|
||||
} else {
|
||||
client.connectToServer(config, presence);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -151,28 +232,30 @@ void Core::Account::connect()
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::onReconnectTimer()
|
||||
{
|
||||
void Core::Account::onReconnectTimer() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
connect();
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::disconnect()
|
||||
{
|
||||
void Core::Account::disconnect() {
|
||||
if (reconnectScheduled) {
|
||||
reconnectScheduled = false;
|
||||
reconnectTimer->stop();
|
||||
}
|
||||
if (state != Shared::ConnectionState::disconnected) {
|
||||
//rh->clearConferences();
|
||||
client.disconnectFromServer();
|
||||
if (state != Shared::ConnectionState::scheduled) {
|
||||
client.disconnectFromServer();
|
||||
} else {
|
||||
state = Shared::ConnectionState::disconnected;
|
||||
emit connectionStateChanged(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::onClientStateChange(QXmppClient::State st)
|
||||
{
|
||||
void Core::Account::onClientStateChange(QXmppClient::State st) {
|
||||
switch (st) {
|
||||
case QXmppClient::ConnectedState: {
|
||||
if (state != Shared::ConnectionState::connected) {
|
||||
@ -180,9 +263,27 @@ void Core::Account::onClientStateChange(QXmppClient::State st)
|
||||
Shared::ConnectionState os = state;
|
||||
state = Shared::ConnectionState::connected;
|
||||
if (os == Shared::ConnectionState::connecting) {
|
||||
qDebug() << "running service discovery for account" << name;
|
||||
dm->requestItems(getServer());
|
||||
dm->requestInfo(getServer());
|
||||
#ifdef WITH_OMEMO
|
||||
if (!oh->hasOwnDevice()) {
|
||||
qDebug() << "setting up OMEMO data for account" << getName();
|
||||
om->changeDeviceLabel(QGuiApplication::applicationDisplayName() + " - " + QSysInfo::productType());
|
||||
QXmppTask<bool> future = om->setUp();
|
||||
future.then(this, [this] (bool result) {
|
||||
if (result)
|
||||
qDebug() << "successfully set up OMEMO data for account" << getName();
|
||||
else
|
||||
qDebug() << "couldn't set up OMEMO data for account" << getName();
|
||||
|
||||
if (state == Shared::ConnectionState::connected)
|
||||
runDiscoveryService();
|
||||
|
||||
});
|
||||
} else {
|
||||
runDiscoveryService();
|
||||
}
|
||||
#else
|
||||
runDiscoveryService();
|
||||
#endif
|
||||
}
|
||||
lastError = Error::none;
|
||||
emit connectionStateChanged(state);
|
||||
@ -214,8 +315,7 @@ void Core::Account::onClientStateChange(QXmppClient::State st)
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::reconnect()
|
||||
{
|
||||
void Core::Account::reconnect() {
|
||||
if (!reconnectScheduled) { //TODO define behavior if It was connection or disconnecting
|
||||
if (state == Shared::ConnectionState::connected) {
|
||||
reconnectScheduled = true;
|
||||
@ -227,8 +327,7 @@ void Core::Account::reconnect()
|
||||
}
|
||||
}
|
||||
|
||||
Shared::Availability Core::Account::getAvailability() const
|
||||
{
|
||||
Shared::Availability Core::Account::getAvailability() const {
|
||||
if (state == Shared::ConnectionState::connected) {
|
||||
QXmppPresence::AvailableStatusType pres = presence.availableStatusType();
|
||||
return static_cast<Shared::Availability>(pres); //they are compatible;
|
||||
@ -237,37 +336,42 @@ Shared::Availability Core::Account::getAvailability() const
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::setAvailability(Shared::Availability avail)
|
||||
{
|
||||
void Core::Account::setAvailability(Shared::Availability avail) {
|
||||
if (avail == Shared::Availability::offline) {
|
||||
disconnect(); //TODO not sure how to do here - changing state may cause connection or disconnection
|
||||
} else {
|
||||
QXmppPresence::AvailableStatusType pres = static_cast<QXmppPresence::AvailableStatusType>(avail);
|
||||
|
||||
presence.setAvailableStatusType(pres);
|
||||
if (state != Shared::ConnectionState::disconnected) {
|
||||
if (state != Shared::ConnectionState::disconnected)
|
||||
client.setClientPresence(presence);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Account::onPresenceReceived(const QXmppPresence& p_presence)
|
||||
{
|
||||
void Core::Account::runDiscoveryService() {
|
||||
qDebug() << "running service discovery for account" << name;
|
||||
dm->requestItems(getServer());
|
||||
dm->requestInfo(getServer());
|
||||
}
|
||||
|
||||
void Core::Account::onPresenceReceived(const QXmppPresence& p_presence) {
|
||||
QString id = p_presence.from();
|
||||
QStringList comps = id.split("/");
|
||||
QString jid = comps.front().toLower();
|
||||
QString resource = comps.back();
|
||||
|
||||
if (jid == getBareJid()) {
|
||||
if (resource == getResource()) {
|
||||
if (resource == getResource())
|
||||
emit availabilityChanged(static_cast<Shared::Availability>(p_presence.availableStatusType()));
|
||||
} else {
|
||||
vh->handleOtherPresenceOfMyAccountChange(p_presence);
|
||||
}
|
||||
|
||||
vh->handlePresenceOfMyAccountChange(p_presence);
|
||||
} else {
|
||||
RosterItem* item = rh->getRosterItem(jid);
|
||||
if (item != 0) {
|
||||
item->handlePresence(p_presence);
|
||||
if (item != nullptr) {
|
||||
if (item->isMuc()) //MUC presence is handled by inner muc events
|
||||
return;
|
||||
else |