telepathyim / telepathy-qt Goto Github PK
View Code? Open in Web Editor NEWTelepathy Qt bindings
Home Page: https://telepathy.freedesktop.org
License: GNU Lesser General Public License v2.1
Telepathy Qt bindings
Home Page: https://telepathy.freedesktop.org
License: GNU Lesser General Public License v2.1
============= telepathy-qt ============= This is a library for Qt-based Telepathy clients and services. Telepathy is a D-Bus framework for unifying real time communication, including instant messaging, voice calls and video calls. It abstracts differences between protocols to provide a unified interface for applications. See the Telepathy website for more information: http://telepathy.freedesktop.org/ Telepathy specification ======================= The copy of the Telepathy specification in the spec/ directory indicates the specification that this library claims to implement. The HTML documentation for the latest version of the specification can be viewed at: http://telepathy.freedesktop.org/spec/ Requirements ============ Building telepathy-qt requires: Qt (DBus, Network and Xml for the library; Gui and Widgets are required for some examples) <https://www.qt.io> CMake <https://cmake.org/> pkg-config <https://pkg-config.freedesktop.org/> Python 3 <https://www.python.org/> For the full set of regression tests to run, you'll also need: telepathy-glib <https://telepathy.freedesktop.org/releases/telepathy-glib/> For building the Farsight convenience library, you'll need: telepathy-glib <https://telepathy.freedesktop.org/releases/telepathy-glib/> telepathy-farsight <https://telepathy.freedesktop.org/releases/telepathy-farsight/> GStreamer <https://gstreamer.freedesktop.org/> and to build the Farstream convenience library, you'll need: telepathy-glib <https://telepathy.freedesktop.org/releases/telepathy-glib/> telepathy-farstream <https://telepathy.freedesktop.org/releases/telepathy-farstream/> farstream <https://freedesktop.org/software/farstream/releases/> GStreamer <https://gstreamer.freedesktop.org/> See CMakeLists.txt for full details, including versions required. Of the packages listed above, only Qt libraries are required at runtime. Bugs, feature requests and to-do list ===================================== Report all bugs, feature requests and "to-do" items here: <https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=tp-qt> Running "make check" will produce FIXME.out, which lists all the mentions of FIXME, TODO or XXX in the source code. Ideally, all of these should be in Bugzilla, but sometimes they're not. API stability policy ==================== We use an "odd/even" versioning scheme where the minor version (the y in x.y.z) determines stability - stable branches have y even, development branches have y odd. In a stable (even) branch, we will not make incompatible API or ABI changes between one release tarball and the next. In a development (odd) branch, if we make incompatible ABI changes between one release tarball and the next, we will change the SONAME of the library; we will attempt to avoid incompatible API or ABI changes. Unreleased builds straight from git identify themselves as version "x.y.z.1". We DO NOT make any API guarantees about unreleased builds: any binary relying on new functionality from an unreleased build is not guaranteed to work with any subsequent release or unreleased build, and on platforms with versioned symbols (mainly Linux) it definitely won't work with subsequent releases (you'll have to at least relink the binary). We do not increment SONAMEs on the basis of unreleased changes. Unreleased builds are compiled with -Werror, so they might stop working if your gcc version issues more warnings than ours. If this is a problem for you, use a release tarball. Contact info ============ This library is maintained by the Telepathy project: <https://github.com/TelepathyIM> <https://telepathy.freedesktop.org> <mailto:[email protected]> <irc://irc.freenode.net/telepathy> Telepathy development was supported by Collabora Ltd. <http://www.collabora.co.uk/>. Hacking ======= See HACKING for version control, coding style and patch submission information.
The API of the interface is too primitive. The proper way to go is to use setChatStates
that emits signals automatically (based on the diff to the previous ChatStateMap.
We need to be able to delay DBus answers, but it is not possible with current design.
Some methods need to make a network request before complete the call.
Examples:
Telepathy-Morse also needs to delay Connection.Interface.Requests CreateChannel() to get a native identifier of created group chat.
GNUInstallDirs.cmake has correct default for all sorts of directories, it also handles things like lib/lib32/lib64/… automagically. Porting to this module is advisable, it makes things much more portable. It also has a mechanism for users to override these defaults if necessary, which is also one that can be used on all projects using this modules.
Using the CMAKE_INSTALL_FULL_* variables of this module in the generated .pc file is advisable as it is the only way that things will work if e.g. the include dir is placed outside of ${prefix}.
"When using the SASL SCRAM mechanism, the SCRAM-SHA-256-PLUS variant SHOULD be preferred over the SCRAM-SHA-256 variant, and SHA-256 variants [RFC7677] SHOULD be preferred over SHA-1 variants [RFC5802]".
Can you add support for?
SCRAM-SHA-1(-PLUS):
-- https://tools.ietf.org/html/rfc5802
-- https://tools.ietf.org/html/rfc6120
SCRAM-SHA-256(-PLUS):
-- https://tools.ietf.org/html/rfc7677 since 2015-11-02
-- https://tools.ietf.org/html/rfc8600 since 2019-06-21: https://mailarchive.ietf.org/arch/msg/ietf-announce/suJMmeMhuAOmGn_PJYgX5Vm8lNA
I add SCRAM-SHA-512(-PLUS): https://xmpp.org/extensions/inbox/hash-recommendations.html
Linked to:
We need to adjust generator (qt-types-gen.py:302, qt-types-gen.py:563) to add
std::initializer_list<T> args
, where T is array_of
.
Expected diff in generated files:
struct TP_QT_EXPORT UIntList : public QList<uint>
{
UIntList() : QList<uint>() {}
UIntList(const QList<uint>& a) : QList<uint>(a) {}
+ UIntList(std::initializer_list<uint> args) : QList<uint>(args) { }
UIntList& operator=(const QList<uint>& a)
{
*(static_cast<QList<uint>*>(this)) = a;
return *this;
}
};
A channel type for logs retrieve. Inspired by Channel.Type.RoomList. Can be used to retrieve logs without opening channels for all possible targets.
Acceptable filter keys listed in FilterKeys property
MessageHeader part:
Possible (optional) keys:
Objects implementing this interface must also implement: Channel.Type.Text
and Channel.Interface.Messages
.
Acceptable filter keys listed in FilterKeys property
Once the method is called, it emits Channel.Interface.Messages MessageReceived (aa{sv}: Message)
signals for received scroll-back messages
Possible (optional) keys:
XEP-0136: Message Archiving
XEP-0313: Message Archive Management
messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
messages.getDialogs#6b47f94d offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;
messages.getHistory#8a8ec2da peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.deleteHistory#b7c13bd9 peer:InputPeer max_id:int = messages.AffectedHistory;
messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
https://core.telegram.org/method/messages.getHistory
https://core.telegram.org/method/messages.deleteHistory
https://core.telegram.org/method/messages.getDialogs
https://core.telegram.org/method/messages.getMessages
https://core.telegram.org/method/messages.deleteMessages
"If additional channels are created as a side-effect of a call to CreateChannel, these channels SHOULD appear in the same NewChannels signal as the channel that satisfies the request."
(from http://telepathy.freedesktop.org/spec/Connection_Interface_Requests.html#Signal:NewChannels)
We should allow to add several channels with single NewChannels signal emission.
See also: http://telepathy.freedesktop.org/spec/Channel_Future.html#Property:Bundle
Besides of the documentation, it would be good to also add an inline example, such as:
#include <TelepathyQt/BaseDebug>
static QPointer<Tp::BaseDebug> debugInterfacePtr;
static QtMessageHandler defaultMessageHandler = nullptr;
void telepathyDebugHandler(QtMsgType type, const QMessageLogContext &context,
const QString &msg)
{
if (!debugInterfacePtr.isNull()) {
const QString domain = QStringLiteral("%1:%2, %3")
.arg(QString::fromLatin1(context.file))
.arg(context.line)
.arg(QString::fromLatin1(context.function));
switch (type) {
case QtDebugMsg:
debugInterfacePtr->newDebugMessage(domain, Tp::DebugLevelDebug, msg);
break;
case QtInfoMsg:
debugInterfacePtr->newDebugMessage(domain, Tp::DebugLevelInfo, msg);
break;
case QtWarningMsg:
debugInterfacePtr->newDebugMessage(domain, Tp::DebugLevelWarning, msg);
break;
case QtCriticalMsg:
debugInterfacePtr->newDebugMessage(domain, Tp::DebugLevelCritical, msg);
break;
case QtFatalMsg:
debugInterfacePtr->newDebugMessage(domain, Tp::DebugLevelError, msg);
break;
}
}
if (defaultMessageHandler) {
defaultMessageHandler(type, context, msg);
return;
}
const QString logMessage = qFormatLogMessage(type, context, msg);
if (logMessage.isNull()) {
return;
}
fprintf(stderr, "%s\n", logMessage.toLocal8Bit().constData());
fflush(stderr);
}
bool enableDebugInterface()
{
if (!debugInterfacePtr.isNull()) {
return debugInterfacePtr->isRegistered();
}
debugInterfacePtr = new Tp::BaseDebug();
debugInterfacePtr->setGetMessagesLimit(-1);
if (!debugInterfacePtr->registerObject(TP_QT_CONNECTION_MANAGER_BUS_NAME_BASE
+ QLatin1String("example"))) {
return false;
}
defaultMessageHandler = qInstallMessageHandler(telepathyDebugHandler);
return true;
}
void disableDebugInterface()
{
if (debugInterfacePtr.isNull()) {
return;
}
qInstallMessageHandler(defaultMessageHandler);
debugInterfacePtr->deleteLater();
debugInterfacePtr.clear();
defaultMessageHandler = nullptr;
}
Wire up org.freedesktop.Telepathy.Account.Interface.Storage properties, such as
StorageRestrictions, StorageIdentifier, StorageSpecificInformation and StorageProvider.
StorageRestrictions is wanted for TelepathyIM/telepathy-ofono#1 (account presence service needs to know StorageRestrictions, especially Cannot_Set_Presence
.
More clear documentation would help linux newbies to solve the problems.
This will let us to fix tests (which are hardly maintainable with qt4) and just clean the code.
Two commits:
the first adds the default implementation, which returns empty map,
the second removes all override implementations, which return empty map.
0.9.8 was released four years ago. The commits since then appear to be mostly bug fixes. Would be nice to have them in an official release.
Remove own smart pointer classes or rationalize their existance.
On NixOS, the build fails with the following error:
[ 62%] Building CXX object TelepathyQt/Farstream/CMakeFiles/telepathy-qt4-farstream.dir/channel.cpp.o
In file included from /nix/store/kjy4n27qjfyrw3ayxh7351hllwvp9g2k-telepathy-glib-0.24.1/include/telepathy-1.0/telepathy-glib/connection.h:33:0,
from /nix/store/kjy4n27qjfyrw3ayxh7351hllwvp9g2k-telepathy-glib-0.24.1/include/telepathy-1.0/telepathy-glib/account.h:31,
from /nix/store/kjy4n27qjfyrw3ayxh7351hllwvp9g2k-telepathy-glib-0.24.1/include/telepathy-1.0/telepathy-glib/account-channel-request.h:32,
from /nix/store/kjy4n27qjfyrw3ayxh7351hllwvp9g2k-telepathy-glib-0.24.1/include/telepathy-1.0/telepathy-glib/telepathy-glib.h:34,
from /nix/store/b7s2b8xjvi7gjfx928v7q655a2p3h3as-telepathy-farstream-0.6.2/include/telepathy-1.0/telepathy-farstream/channel.h:6,
from /nix/store/b7s2b8xjvi7gjfx928v7q655a2p3h3as-telepathy-farstream-0.6.2/include/telepathy-1.0/telepathy-farstream/telepathy-farstream.h:23,
from /tmp/nix-build-telepathy-qt-0.9.7.drv-0/telepathy-qt-0.9.7/TelepathyQt/Farstream/channel.cpp:31:
/nix/store/kjy4n27qjfyrw3ayxh7351hllwvp9g2k-telepathy-glib-0.24.1/include/telepathy-1.0/telepathy-glib/proxy.h:29:28: fatal error: dbus/dbus-glib.h: No such file or directory
#include <dbus/dbus-glib.h>
^
compilation terminated.
make[2]: *** [TelepathyQt/Farstream/CMakeFiles/telepathy-qt4-farstream.dir/build.make:68: TelepathyQt/Farstream/CMakeFiles/telepathy-qt4-farstream.dir/channel.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8856: TelepathyQt/Farstream/CMakeFiles/telepathy-qt4-farstream.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Nix stores each library in a separate directory in the Nix store. If I add the output of pkg-config --cflags dbus-glib-1
to build flags, it builds fine, it probably needs to be listed somewhere in the CMakeLists
.
We need to decide if it will be better to add features and polish them (in spec 0.28 and TelepathyQt-0.10) before 1.0 release, or easy the development by dropping all the deprecated stuff and moving to 1.0.
Pros:
Cons:
Links:
https://github.com/davidedmundson/telepathy-qt/tree/next (190 commits ahead)
We use Python 2.7 for code generation. Port the scripts to python3.
See also: https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal
The modern approach to use the org.freedesktop.DBus.Properties.PropertiesChanged
signal for property changed notification is not supported on the client side.
See also: TelepathyIM/telepathy-glib@5894586
InspectHandles removed in Telepathy 1.0 by commit
Remove InspectHandles
Identifiers are always given together with handles, so it must never be needed to inspect an handle.
This makes sense, so we need to:
Recently when I tried installing telepathy-qt for Debian without the apt sources packages, I encountered this error. I had to configure telepathy-qt from apt sources in the end. The exact ending of the error log was :
Makefile:141: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/athena/telepathy-qt-stuff/telepathy-qt-0.9.6.1/obj-x86_64-linux-gnu'
dh_auto_build: make -j13 returned exit code 2
debian/rules:20: recipe for target 'override_dh_auto_build-arch' failed
make[1]: *** [override_dh_auto_build-arch] Error 2
make[1]: Leaving directory '/home/athena/telepathy-qt-stuff/telepathy-qt-0.9.6.1'
debian/rules:12: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
The entire log for building the code is really long and given here
The Disconnect() method of Connection should close all channel with Channel::Closed() and Connection.Interface.Requests ChannelClosed() signals emission.
Required #9 to be done first
The interface is inspired by Channel.Interface.SASLAuthentication.
The description is outdated (written for Channel.Interface.PhoneVerification, which would be generalised to One-time password Authentication).
The interface would be exposed by telepathy-morse (telegram connection manager). Sign in process would be follow:
Read only.
Read only, can be changed.
Method list depends on protocol and server. Well-known values would be:
Since v2
Since v2
Read only, can be empty.
Predefined phone number, which will receive the message or the call.
Sometimes you can get a call only if you already tried to get sms and not received it yet (Telegram case).
Possible optional keys:
Activate the "method" to get a code on passed phone number.
The phone argument can be not associated with the account, or can be not permanent for some protocol/server/etc.
Probably this argument would be needed by Telegram CM to perform change of the user phone number.
Artificial use case can be phone verification to connect to some room in jabber, or (as we have "Account balance" interface), it is pretty possible to use phone verification to add some money to the balance. You send phone number, server replies you with a code, you send it back and ooop - you just confirmed a transfer of 5$ from the phone number balance.
Try to complete verification with the "code".
It seems that the project is not ported to 0.23.4.
See:
http://telepathy.freedesktop.org/spec/Channel_Interface_Group.html#Signal:HandleOwnersChanged
Please add support of https://xmpp.org/extensions/xep-0412.html
Which replaces:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.