[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:24:53 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=6a007c1

The following commit has been merged in the master branch:
commit 6a007c1c963a4f7520bfd82eaa5f0b7654fd57dc
Author: Marcin Ziemiński <zieminn at gmail.com>
Date:   Wed Aug 27 00:08:17 2014 +0200

    Add OTR filter to conceal encrypted messages
---
 filters/CMakeLists.txt                             |  1 +
 filters/{youtube => otr}/CMakeLists.txt            | 21 ++++++++--------
 .../otr/ktptextui_message_filter_otr.desktop.cmake | 16 +++++++++++++
 .../{latex/latex-config.cpp => otr/otr-filter.cpp} | 28 +++++++++++-----------
 .../{youtube/youtube-filter.h => otr/otr-filter.h} | 13 +++++-----
 5 files changed, 47 insertions(+), 32 deletions(-)

diff --git a/filters/CMakeLists.txt b/filters/CMakeLists.txt
index 7a9528a..9e65593 100644
--- a/filters/CMakeLists.txt
+++ b/filters/CMakeLists.txt
@@ -7,6 +7,7 @@ add_subdirectory(searchexpansion)
 add_subdirectory(youtube)
 add_subdirectory(highlight)
 add_subdirectory(urlexpansion)
+add_subdirectory(otr)
 
 IF (EXISTS "${KDE4_DBUS_INTERFACES_DIR}/org.kde.KSpeech.xml")
     set (HAS_KTTS TRUE)
diff --git a/filters/youtube/CMakeLists.txt b/filters/otr/CMakeLists.txt
similarity index 50%
copy from filters/youtube/CMakeLists.txt
copy to filters/otr/CMakeLists.txt
index 1bceadb..cfba7e9 100644
--- a/filters/youtube/CMakeLists.txt
+++ b/filters/otr/CMakeLists.txt
@@ -1,28 +1,27 @@
-set (ktptextui_message_filter_youtube_SRCS
-     youtube-filter.cpp
+set (ktptextui_message_filter_otr_SRCS
+     otr-filter.cpp
 )
 
-kde4_add_plugin (ktptextui_message_filter_youtube
-                 ${ktptextui_message_filter_youtube_SRCS}
+kde4_add_plugin (ktptextui_message_filter_otr
+                 ${ktptextui_message_filter_otr_SRCS}
 )
 
-target_link_libraries (ktptextui_message_filter_youtube
-    ktpchat
+target_link_libraries (ktptextui_message_filter_otr
     ${QT_LIBRARIES}
     ${KDE4_KIO_LIBS}
-    ${TELEPATHY_QT4_LIBRARIES}
     ${KTP_LIBRARIES}
+    ${KTP_OTR_LIBRARIES}
 )
 
 # Install:
-install (TARGETS ktptextui_message_filter_youtube
+install (TARGETS ktptextui_message_filter_otr
          DESTINATION ${PLUGIN_INSTALL_DIR}
 )
 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ktptextui_message_filter_youtube.desktop.cmake
-               ${CMAKE_CURRENT_BINARY_DIR}/ktptextui_message_filter_youtube.desktop
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ktptextui_message_filter_otr.desktop.cmake
+               ${CMAKE_CURRENT_BINARY_DIR}/ktptextui_message_filter_otr.desktop
                @ONLY)
 
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ktptextui_message_filter_youtube.desktop
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ktptextui_message_filter_otr.desktop
          DESTINATION ${SERVICES_INSTALL_DIR}
 )
diff --git a/filters/otr/ktptextui_message_filter_otr.desktop.cmake b/filters/otr/ktptextui_message_filter_otr.desktop.cmake
new file mode 100644
index 0000000..31eadb7
--- /dev/null
+++ b/filters/otr/ktptextui_message_filter_otr.desktop.cmake
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=OTR
+Comment=If a message is an OTR message, it will not be shown
+Encoding=UTF-8
+Type=Service
+ServiceTypes=KTpTextUi/MessageFilter
+
+X-KDE-Library=ktptextui_message_filter_otr
+X-KDE-PluginInfo-Author=Marcin Ziemiński
+X-KDE-PluginInfo-Email=zieminn at gmail.com
+X-KDE-PluginInfo-Name=otr
+X-KDE-PluginInfo-Version=@KTP_TEXT_UI_VERSION@
+X-KDE-PluginInfo-Website=http://community.kde.org/KTp
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+X-KTp-PluginInfo-Version=@KTP_MESSAGE_FILTER_FRAMEWORK_VERSION@
diff --git a/filters/latex/latex-config.cpp b/filters/otr/otr-filter.cpp
similarity index 57%
copy from filters/latex/latex-config.cpp
copy to filters/otr/otr-filter.cpp
index 1169c59..66708fb 100644
--- a/filters/latex/latex-config.cpp
+++ b/filters/otr/otr-filter.cpp
@@ -1,5 +1,5 @@
 /*
- *    Copyright (C) 2013  Andrea Scarpino <andrea at archlinux.org>
+ *    Copyright (C) 2014  Marcin Ziemiński <zieminn at gmail.com>
  *
  *    This library is free software; you can redistribute it and/or
  *    modify it under the terms of the GNU Lesser General Public
@@ -16,25 +16,25 @@
  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */
 
-#include "latex-config.h"
-// KConfigSkeleton
-#include "latexconfig.h"
+#include "otr-filter.h"
 
-#include <KPluginFactory>
+#include <KTp/OTR/utils.h>
 
-K_PLUGIN_FACTORY(LatexConfigFactory, registerPlugin<LatexFilterConfig>();)
-K_EXPORT_PLUGIN(LatexConfigFactory( "kcm_ktptextui_message_filter_latex" ))
+#include <KPluginFactory>
+#include <KDebug>
+#include <KLocale>
 
-LatexFilterConfig::LatexFilterConfig(QWidget* parent, const QVariantList& args)
-    : KCModule(LatexConfigFactory::componentData(), parent, args)
+OTRFilter::OTRFilter(QObject *parent, const QVariantList &) :
+    AbstractMessageFilter(parent)
 {
-    ui.setupUi(this);
-    addConfig(LatexConfig::self(), this);
-    load();
 }
 
-LatexFilterConfig::~LatexFilterConfig()
+void OTRFilter::filterMessage(KTp::Message &message, const KTp::MessageContext&)
 {
+    if(KTp::Utils::isOtrMessage(message.mainMessagePart())) {
+        message.setMainMessagePart(i18n("<i>Encrypted message</i>"));
+    }
 }
 
-#include "latex-config.moc"
\ No newline at end of file
+K_PLUGIN_FACTORY(MessageFilterFactory, registerPlugin<OTRFilter>();)
+K_EXPORT_PLUGIN(MessageFilterFactory("ktptextui_message_filter_otr"))
diff --git a/filters/youtube/youtube-filter.h b/filters/otr/otr-filter.h
similarity index 77%
copy from filters/youtube/youtube-filter.h
copy to filters/otr/otr-filter.h
index dbea04a..e3cc36b 100644
--- a/filters/youtube/youtube-filter.h
+++ b/filters/otr/otr-filter.h
@@ -1,5 +1,5 @@
 /*
- *    Copyright (C) 2012  Lasath Fernando <kde at lasath.org>
+ *    Copyright (C) 2014  Marcin Ziemiński <zieminn at gmail.com>
  *
  *    This library is free software; you can redistribute it and/or
  *    modify it under the terms of the GNU Lesser General Public
@@ -16,19 +16,18 @@
  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */
 
-#ifndef YOUTUBE_FILTER_H
-#define YOUTUBE_FILTER_H
+#ifndef OTR_FILTER_H
+#define OTR_FILTER_H
 
 #include <KTp/abstract-message-filter.h>
 
-class YoutubeFilter : public KTp::AbstractMessageFilter
+class OTRFilter : public KTp::AbstractMessageFilter
 {
     Q_OBJECT
 
 public:
-    YoutubeFilter(QObject *parent, const QVariantList &);
-    virtual ~YoutubeFilter();
+    OTRFilter(QObject *parent, const QVariantList &);
     virtual void filterMessage(KTp::Message &message, const KTp::MessageContext &context);
 };
 
-#endif // YOUTUBE_FILTER_H
+#endif // OTR_FILTER_H

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list