Merge branch 'master' into build/multicore
All checks were successful
CI / Check spelling (pull_request) Successful in 21s
CI / Test C API Documentation Generation (pull_request) Successful in 26s
CI / Check coding style (pull_request) Successful in 35s
CI / Test Python API Documentation Generation (pull_request) Successful in 27s
CI / Linux (ubuntu) (pull_request) Successful in 15m24s
CI / Linux (debian) (pull_request) Successful in 15m38s
CI / Linux (arch) (pull_request) Successful in 18m26s
All checks were successful
CI / Check spelling (pull_request) Successful in 21s
CI / Test C API Documentation Generation (pull_request) Successful in 26s
CI / Check coding style (pull_request) Successful in 35s
CI / Test Python API Documentation Generation (pull_request) Successful in 27s
CI / Linux (ubuntu) (pull_request) Successful in 15m24s
CI / Linux (debian) (pull_request) Successful in 15m38s
CI / Linux (arch) (pull_request) Successful in 18m26s
This commit is contained in:
44
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
44
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
<!--- More than 50 issues open? Please don't file any new feature requests -->
|
||||||
|
<!--- Help us reduce the work first :-) -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
<!--- If you're describing a bug, tell us what should happen -->
|
||||||
|
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||||
|
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||||
|
|
||||||
|
## Possible Solution
|
||||||
|
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||||
|
<!--- or ideas how to implement the addition or change -->
|
||||||
|
|
||||||
|
## Steps to Reproduce (for bugs)
|
||||||
|
<!--- Describe, in detail, what needs to happen to reproduce this bug -->
|
||||||
|
<!--- Give us a screenshot (if it's helpful for this particular bug) -->
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
4.
|
||||||
|
|
||||||
|
## Context
|
||||||
|
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
* Give us the version and build information output generated by `profanity -v`
|
||||||
|
* If you could not yet build profanity, mention the revision you try to build from
|
||||||
|
* Operating System/Distribution
|
||||||
|
* glib version
|
||||||
|
* libstrophe version
|
||||||
|
* Some bugs might be due to specific implementation in the server. `/serversoftware example.domain` can be helpful
|
||||||
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
@@ -90,3 +90,31 @@ jobs:
|
|||||||
- name: Check spelling
|
- name: Check spelling
|
||||||
run: |
|
run: |
|
||||||
codespell
|
codespell
|
||||||
|
|
||||||
|
test-c-api-docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test C API Documentation Generation
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends make doxygen
|
||||||
|
- name: Test C API docs generation
|
||||||
|
run: |
|
||||||
|
cd apidocs/c/
|
||||||
|
doxygen c-prof.conf
|
||||||
|
|
||||||
|
test-python-api-docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test Python API Documentation Generation
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends make python3-sphinx
|
||||||
|
- name: Test Python API docs generation
|
||||||
|
run: |
|
||||||
|
cd apidocs/python/
|
||||||
|
sphinx-apidoc -f -o . src && make -j$(nproc) xml SPHINXOPTS="-W --keep-going -n"
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ unittest_sources = \
|
|||||||
src/event/server_events.c src/event/server_events.h \
|
src/event/server_events.c src/event/server_events.h \
|
||||||
src/event/client_events.c src/event/client_events.h \
|
src/event/client_events.c src/event/client_events.h \
|
||||||
src/ui/tray.h src/ui/tray.c \
|
src/ui/tray.h src/ui/tray.c \
|
||||||
|
tests/prof_cmocka.h \
|
||||||
tests/unittests/xmpp/stub_vcard.c \
|
tests/unittests/xmpp/stub_vcard.c \
|
||||||
tests/unittests/xmpp/stub_avatar.c \
|
tests/unittests/xmpp/stub_avatar.c \
|
||||||
tests/unittests/xmpp/stub_ox.c \
|
tests/unittests/xmpp/stub_ox.c \
|
||||||
@@ -170,6 +171,7 @@ unittest_sources = \
|
|||||||
tests/unittests/unittests.c
|
tests/unittests/unittests.c
|
||||||
|
|
||||||
functionaltest_sources = \
|
functionaltest_sources = \
|
||||||
|
tests/prof_cmocka.h \
|
||||||
tests/functionaltests/proftest.c tests/functionaltests/proftest.h \
|
tests/functionaltests/proftest.c tests/functionaltests/proftest.h \
|
||||||
tests/functionaltests/test_connect.c tests/functionaltests/test_connect.h \
|
tests/functionaltests/test_connect.c tests/functionaltests/test_connect.h \
|
||||||
tests/functionaltests/test_ping.c tests/functionaltests/test_ping.h \
|
tests/functionaltests/test_ping.c tests/functionaltests/test_ping.h \
|
||||||
@@ -284,6 +286,7 @@ endif
|
|||||||
|
|
||||||
TESTS = tests/unittests/unittests
|
TESTS = tests/unittests/unittests
|
||||||
check_PROGRAMS = tests/unittests/unittests
|
check_PROGRAMS = tests/unittests/unittests
|
||||||
|
tests_unittests_unittests_CPPFLAGS = -Itests/
|
||||||
tests_unittests_unittests_SOURCES = $(unittest_sources)
|
tests_unittests_unittests_SOURCES = $(unittest_sources)
|
||||||
tests_unittests_unittests_LDADD = -lcmocka
|
tests_unittests_unittests_LDADD = -lcmocka
|
||||||
|
|
||||||
@@ -347,9 +350,13 @@ endif
|
|||||||
.PHONY: my-prof.supp
|
.PHONY: my-prof.supp
|
||||||
my-prof.supp:
|
my-prof.supp:
|
||||||
@sed '/^# AUTO-GENERATED START/q' prof.supp > $@
|
@sed '/^# AUTO-GENERATED START/q' prof.supp > $@
|
||||||
|
@printf "\n\n# glib\n" >> $@
|
||||||
@cat /usr/share/glib-2.0/valgrind/glib.supp >> $@
|
@cat /usr/share/glib-2.0/valgrind/glib.supp >> $@
|
||||||
|
@printf "\n\n# Python\n" >> $@
|
||||||
@wget -O- https://raw.githubusercontent.com/python/cpython/refs/tags/v`python3 --version | cut -d' ' -f2`/Misc/valgrind-python.supp >> $@
|
@wget -O- https://raw.githubusercontent.com/python/cpython/refs/tags/v`python3 --version | cut -d' ' -f2`/Misc/valgrind-python.supp >> $@
|
||||||
|
@printf "\n\n# gtk\n" >> $@
|
||||||
@test -z "@GTK_VERSION@" || wget -O- https://raw.githubusercontent.com/GNOME/gtk/refs/tags/@GTK_VERSION@/gtk.supp >> $@
|
@test -z "@GTK_VERSION@" || wget -O- https://raw.githubusercontent.com/GNOME/gtk/refs/tags/@GTK_VERSION@/gtk.supp >> $@
|
||||||
|
@printf "\n\n# more gtk\n" >> $@
|
||||||
@test -z "@GTK_VERSION@" || cat /usr/share/gtk-3.0/valgrind/gtk.supp >> $@
|
@test -z "@GTK_VERSION@" || cat /usr/share/gtk-3.0/valgrind/gtk.supp >> $@
|
||||||
|
|
||||||
check-unit: tests/unittests/unittests
|
check-unit: tests/unittests/unittests
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -450,7 +450,7 @@ int prof_chat_show_themed(char *barejid, char *group, char *item, char *def, cha
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Show a message in a chat room window.
|
Show a message in a chat room window.
|
||||||
@param barejid Jabber ID of the room
|
@param roomjid Jabber ID of the room
|
||||||
@param message the message to print
|
@param message the message to print
|
||||||
@return 1 on success, 0 on failure
|
@return 1 on success, 0 on failure
|
||||||
*/
|
*/
|
||||||
@@ -459,7 +459,7 @@ int prof_room_show(char *roomjid, char *message);
|
|||||||
/**
|
/**
|
||||||
Show a message in a chat room window, using the specified theme, and prefix character
|
Show a message in a chat room window, using the specified theme, and prefix character
|
||||||
Themes are specified in ~/.local/share/profanity/plugin_themes
|
Themes are specified in ~/.local/share/profanity/plugin_themes
|
||||||
@param barejid Jabber ID of the room
|
@param roomjid Jabber ID of the room
|
||||||
@param group the group name in the themes file or NULL
|
@param group the group name in the themes file or NULL
|
||||||
@param item the item name within the group or NULL
|
@param item the item name within the group or NULL
|
||||||
@param def default colour if the theme cannot be found
|
@param def default colour if the theme cannot be found
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Profanity Python Plugins API documentation build configuration file, created by
|
# CProof Python Plugins API documentation build configuration file.
|
||||||
# sphinx-quickstart on Thu Mar 17 23:01:31 2016.
|
|
||||||
#
|
#
|
||||||
# This file is execfile()d with the current directory set to its
|
# This file is execfile()d with the current directory set to its
|
||||||
# containing dir.
|
# containing dir.
|
||||||
@@ -47,25 +46,25 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Profanity Python Plugins API'
|
project = u'CProof Python Plugins API'
|
||||||
copyright = u'2016 - 2018, boothj5'
|
copyright = u'2025, CProof, based on Profanity by boothj5 et al.'
|
||||||
author = u'boothj5'
|
author = u'CProof Developers'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = u'0.5.0'
|
version = u'0.15.0'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = u'0.5.0'
|
release = u'0.15.0'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
#
|
#
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# Usually you set "language" from the command line for these cases.
|
||||||
language = None
|
language = 'en'
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
# non-false value, then it is used:
|
# non-false value, then it is used:
|
||||||
@@ -75,7 +74,7 @@ language = None
|
|||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
exclude_patterns = ['_build']
|
exclude_patterns = ['_build', 'modules.rst']
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
# documents.
|
# documents.
|
||||||
@@ -122,7 +121,7 @@ html_theme = 'default'
|
|||||||
|
|
||||||
# The name for this set of Sphinx documents. If None, it defaults to
|
# The name for this set of Sphinx documents. If None, it defaults to
|
||||||
# "<project> v<release> documentation".
|
# "<project> v<release> documentation".
|
||||||
html_title = "Profanity Python Plugins"
|
html_title = "CProof Python Plugins"
|
||||||
|
|
||||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||||
#html_short_title = None
|
#html_short_title = None
|
||||||
@@ -139,7 +138,7 @@ html_title = "Profanity Python Plugins"
|
|||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
# html_static_path = ['_static']
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
@@ -202,7 +201,7 @@ html_show_copyright = False
|
|||||||
#html_search_scorer = 'scorer.js'
|
#html_search_scorer = 'scorer.js'
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = 'ProfanityPythonPluginsAPIdoc'
|
htmlhelp_basename = 'CProofPythonPluginsAPIdoc'
|
||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
@@ -224,8 +223,8 @@ latex_elements = {
|
|||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
(master_doc, 'ProfanityPythonPluginsAPI.tex', u'Profanity Python Plugins API Documentation',
|
(master_doc, 'CProofPythonPluginsAPI.tex', u'CProof Python Plugins API Documentation',
|
||||||
u'boothj5', 'manual'),
|
u'CProof Developers', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
@@ -254,7 +253,7 @@ latex_documents = [
|
|||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
(master_doc, 'profanitypythonpluginsapi', u'Profanity Python Plugins API Documentation',
|
(master_doc, 'cproofpythonpluginsapi', u'CProof Python Plugins API Documentation',
|
||||||
[author], 1)
|
[author], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
Profanity Python Plugins API
|
CProof Python Plugins API
|
||||||
============================
|
===========================
|
||||||
|
|
||||||
The ``prof`` module describes functions that plugins may call to interact with Profanity.
|
The ``prof`` module describes functions that plugins may call to interact with CProof.
|
||||||
The ``plugin`` module describes functions that plugins may define to be notified of various events in Profanity.
|
The ``plugin`` module describes functions that plugins may define to be notified of various events in CProof.
|
||||||
|
|
||||||
Contents:
|
Contents:
|
||||||
|
|
||||||
@@ -11,4 +11,5 @@ Contents:
|
|||||||
|
|
||||||
prof
|
prof
|
||||||
plugin
|
plugin
|
||||||
* :ref:`genindex`
|
|
||||||
|
:ref:`genindex`
|
||||||
|
|||||||
@@ -1,360 +1,641 @@
|
|||||||
"""
|
"""
|
||||||
This page describes functions that plugins may implement to be called from Profanity on certain events. All functions are optional.
|
The plugin module defines optional callback functions that CProof plugins can
|
||||||
|
implement to handle events such as startup, shutdown, message processing, and
|
||||||
|
presence updates.
|
||||||
|
|
||||||
Examples:
|
|
||||||
::
|
::
|
||||||
def prof_on_start():
|
|
||||||
prof.cons_show("Profanity has started...")
|
|
||||||
|
|
||||||
def prof_pre_room_message_display(room, nick, message):
|
import prof
|
||||||
prof.cons_show("Manipulating chat room message before display...")
|
|
||||||
new_message = message + " (added by plugin)"
|
|
||||||
return new_message
|
|
||||||
|
|
||||||
def prof_on_contact_presence(barejid, resource, presence, status, priority):
|
All functions are optional and are called by CProof when the corresponding event
|
||||||
notify_message = barejid + " is " + presence
|
occurs. String parameters and return values are Python 3 str types.
|
||||||
prof.notify(notify_message, 5, "Presence")
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def prof_init(version, status, account_name, fulljid):
|
# Initialization and Lifecycle
|
||||||
"""Called when a plugin is loaded, either when profanity is started, or when the ``/plugins load`` or ``/plugins install`` commands are called
|
# ---------------------------
|
||||||
|
|
||||||
:param version: the version of Profanity
|
def prof_init(version: str, status: str, account_name: str | None, fulljid: str | None) -> None:
|
||||||
:param status: the package status of Profanity, ``"development"`` or ``"release"``
|
"""Initializes the plugin when loaded by CProof.
|
||||||
:param account_name: account name of the currently logged in account, or ``None`` if not logged in
|
|
||||||
:param fulljid: the users full Jabber ID (barejid and resource) if logged in, ``None`` otherwise
|
Called when CProof starts or when the plugin is loaded via the ``/plugins load``
|
||||||
:type version: str or unicode
|
or ``/plugins install`` commands.
|
||||||
:type status: str or unicode
|
|
||||||
:type account_name: str, unicode or None
|
Args:
|
||||||
:type fulljid: str, unicode or None
|
version: The version of CProof (e.g., ``"1.0.0"``).
|
||||||
|
status: The package status of CProof (``"development"`` or ``"release"``).
|
||||||
|
account_name: The account name of the logged-in user, or None if not logged in.
|
||||||
|
fulljid: The full Jabber ID (barejid/resource) of the logged-in user, or None if not logged in.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_init(version: str, status: str, account_name: str | None, fulljid: str | None) -> None:
|
||||||
|
prof.cons_show(f"MyPlugin for CProof {version} ({status}) has been loaded, account: {account_name}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_start() -> None:
|
||||||
|
"""Called when CProof starts.
|
||||||
|
|
||||||
def prof_on_start():
|
Use this to perform setup tasks that should occur at application startup.
|
||||||
"""Called when Profanity is started
|
|
||||||
|
Args:
|
||||||
|
None
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_start() -> None:
|
||||||
|
prof.cons_show("CProof has started...")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_shutdown() -> None:
|
||||||
|
"""Called when CProof is shutting down.
|
||||||
|
|
||||||
def prof_on_shutdown():
|
Use this to perform cleanup tasks before the application exits.
|
||||||
"""Called when the user quits Profanity
|
|
||||||
|
Args:
|
||||||
|
None
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_shutdown() -> None:
|
||||||
|
prof.cons_show("CProof is shutting down...")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_unload() -> None:
|
||||||
|
"""Called when the plugin is unloaded via the ``/plugins unload`` command.
|
||||||
|
|
||||||
def prof_on_unload():
|
Use this to clean up plugin-specific resources.
|
||||||
"""Called when a plugin is unloaded with the ``/plugins unload`` command
|
|
||||||
|
Args:
|
||||||
|
None
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_unload() -> None:
|
||||||
|
prof.cons_show("Plugin unloaded")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_connect(account_name: str, fulljid: str) -> None:
|
||||||
|
"""Called when a user connects to CProof with an account.
|
||||||
|
|
||||||
def prof_on_connect(account_name, fulljid):
|
Args:
|
||||||
"""Called when the user connects with an account
|
account_name: The account name used for login.
|
||||||
|
fulljid: The full Jabber ID (barejid/resource) of the connected account.
|
||||||
|
|
||||||
:param account_name: account name of the account used for logging in
|
Returns:
|
||||||
:param fulljid: the full Jabber ID (barejid and resource) of the account
|
None
|
||||||
:type account_name: str or unicode
|
|
||||||
:type fulljid: str or unicode
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_connect(account_name: str, fulljid: str) -> None:
|
||||||
|
prof.cons_show(f"Connected as {account_name} ({fulljid})")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_disconnect(account_name: str, fulljid: str) -> None:
|
||||||
|
"""Called when a user disconnects an account from CProof.
|
||||||
|
|
||||||
def prof_on_disconnect(account_name, fulljid):
|
Args:
|
||||||
"""Called when the user disconnects an account
|
account_name: The account name being disconnected.
|
||||||
|
fulljid: The full Jabber ID (barejid/resource) of the disconnected account.
|
||||||
|
|
||||||
:param account_name: account name of the account being disconnected
|
Returns:
|
||||||
:param fulljid: the full Jabber ID (barejid and resource) of the account
|
None
|
||||||
:type account_name: str or unicode
|
|
||||||
:type fulljid: str or unicode
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_disconnect(account_name: str, fulljid: str) -> None:
|
||||||
|
prof.cons_show(f"Disconnected {account_name} ({fulljid})")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Chat Message Handlers
|
||||||
|
# ---------------------
|
||||||
|
|
||||||
def prof_pre_chat_message_display(barejid, resource, message):
|
def prof_pre_chat_message_display(barejid: str, resource: str, message: str) -> str | None:
|
||||||
"""Called before a chat message is displayed
|
"""Called before a chat message is displayed in a chat window.
|
||||||
|
|
||||||
:param barejid: Jabber ID of the message sender
|
Allows the plugin to modify or cancel the message display.
|
||||||
:param resource: resource of the message sender
|
|
||||||
:param message: the received message
|
Args:
|
||||||
:type barejid: str or unicode
|
barejid: The Jabber ID of the message sender (e.g., ``bob@example.com``).
|
||||||
:type resource: str or unicode
|
resource: The sender's resource (e.g., ``laptop``).
|
||||||
:type message: str or unicode
|
message: The received message.
|
||||||
:return: the new message to display, or ``None`` to preserve the original message
|
|
||||||
:rtype: str or unicode
|
Returns:
|
||||||
|
str | None: The modified message to display, or None to preserve the original.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_pre_chat_message_display(barejid: str, resource: str, message: str) -> str | None:
|
||||||
|
new_message = f"{message} (from {barejid})"
|
||||||
|
return new_message
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_post_chat_message_display(barejid: str, resource: str, message: str) -> None:
|
||||||
|
"""Called after a chat message is displayed in a chat window.
|
||||||
|
|
||||||
def prof_post_chat_message_display(barejid, resource, message):
|
Use this to perform actions after the message is shown.
|
||||||
"""Called after a chat message is displayed
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the message sender
|
Args:
|
||||||
:param resource: resource of the message sender
|
barejid: The Jabber ID of the message sender (e.g., ``bob@example.com``).
|
||||||
:param message: the received message
|
resource: The sender's resource (e.g., ``laptop``).
|
||||||
:type barejid: str or unicode
|
message: The displayed message.
|
||||||
:type resource: str or unicode
|
|
||||||
:type message: str or unicode
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_post_chat_message_display(barejid: str, resource: str, message: str) -> None:
|
||||||
|
prof.cons_show(f"Displayed message from {barejid}/{resource}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_pre_chat_message_send(barejid: str, message: str) -> str | None:
|
||||||
|
"""Called before a chat message is sent from CProof.
|
||||||
|
|
||||||
def prof_pre_chat_message_send(barejid, message):
|
Allows the plugin to modify or cancel the message.
|
||||||
"""Called before a chat message is sent
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the message recipient
|
Args:
|
||||||
:param message: the message to be sent
|
barejid: The Jabber ID of the recipient (e.g., ``bob@example.com``).
|
||||||
:type barejid: str or unicode
|
message: The message to be sent.
|
||||||
:type message: str or unicode
|
|
||||||
:return: the modified or original message to send, or ``None`` to cancel sending of the message
|
Returns:
|
||||||
:rtype: str or unicode
|
str | None: The modified message to send, or None to cancel sending.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_pre_chat_message_send(barejid: str, message: str) -> str | None:
|
||||||
|
return f"{message} (sent by plugin)"
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_post_chat_message_send(barejid: str, message: str) -> None:
|
||||||
|
"""Called after a chat message is sent from CProof.
|
||||||
|
|
||||||
def prof_post_chat_message_send(barejid, message):
|
Use this to log or react to sent messages.
|
||||||
"""Called after a chat message has been sent
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the message recipient
|
Args:
|
||||||
:param message: the sent message
|
barejid: The Jabber ID of the recipient (e.g., ``bob@example.com``).
|
||||||
:type barejid: str or unicode
|
message: The sent message.
|
||||||
:type message: str or unicode
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_post_chat_message_send(barejid: str, message: str) -> None:
|
||||||
|
prof.cons_show(f"Sent to {barejid}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Room Message Handlers
|
||||||
|
# ---------------------
|
||||||
|
|
||||||
def prof_pre_room_message_display(barejid, nick, message):
|
def prof_pre_room_message_display(barejid: str, nick: str, message: str) -> str | None:
|
||||||
"""Called before a chat room message is displayed
|
"""Called before a chat room message is displayed.
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Allows the plugin to modify or cancel the message display.
|
||||||
:param nick: nickname of message sender
|
|
||||||
:param message: the received message
|
Args:
|
||||||
:type barejid: str or unicode
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:type nick: str or unicode
|
nick: The nickname of the message sender.
|
||||||
:type message: str or unicode
|
message: The received message.
|
||||||
:return: the new message to display, or ``None`` to preserve the original message
|
|
||||||
:rtype: str or unicode
|
Returns:
|
||||||
|
str | None: The modified message to display, or None to preserve the original.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_pre_room_message_display(barejid: str, nick: str, message: str) -> str | None:
|
||||||
|
return f"{message} (from {nick})"
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_post_room_message_display(barejid: str, nick: str, message: str) -> None:
|
||||||
|
"""Called after a chat room message is displayed.
|
||||||
|
|
||||||
def prof_post_room_message_display(barejid, nick, message):
|
Use this to perform actions after the message is shown.
|
||||||
"""Called after a chat room message is displayed
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Args:
|
||||||
:param nick: nickname of the message sender
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:param message: the received message
|
nick: The nickname of the message sender.
|
||||||
:type barejid: str or unicode
|
message: The displayed message.
|
||||||
:type nick: str or unicode
|
|
||||||
:type message: str or unicode
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_post_room_message_display(barejid: str, nick: str, message: str) -> None:
|
||||||
|
prof.cons_show(f"Displayed in {barejid} from {nick}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_pre_room_message_send(barejid: str, message: str) -> str | None:
|
||||||
|
"""Called before a chat room message is sent.
|
||||||
|
|
||||||
def prof_pre_room_message_send(barejid, message):
|
Allows the plugin to modify or cancel the message.
|
||||||
"""Called before a chat room message is sent
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Args:
|
||||||
:param message: the message to be sent
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:type barejid: str or unicode
|
message: The message to be sent.
|
||||||
:type message: str or unicode
|
|
||||||
:return: the modified or original message to send, or ``None`` to cancel sending of the message
|
Returns:
|
||||||
:rtype: str or unicode
|
str | None: The modified message to send, or None to cancel sending.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_pre_room_message_send(barejid: str, message: str) -> str | None:
|
||||||
|
return f"{message} (sent by plugin)"
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_post_room_message_send(barejid: str, message: str) -> None:
|
||||||
|
"""Called after a chat room message is sent.
|
||||||
|
|
||||||
def prof_post_room_message_send(barejid, message):
|
Use this to log or react to sent messages.
|
||||||
"""Called after a chat room message has been sent
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Args:
|
||||||
:param message: the sent message
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:type barejid: str or unicode
|
message: The sent message.
|
||||||
:type message: str or unicode
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_post_room_message_send(barejid: str, message: str) -> None:
|
||||||
|
prof.cons_show(f"Sent to {barejid}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_room_history_message(barejid: str, nick: str, message: str, timestamp: str) -> None:
|
||||||
|
"""Called when a chat room history message is received from the server.
|
||||||
|
|
||||||
def prof_on_room_history_message(barejid, nick, message, timestamp):
|
Args:
|
||||||
"""Called when the server sends a chat room history message
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
|
nick: The nickname of the message sender.
|
||||||
|
message: The received message.
|
||||||
|
timestamp: The message's original send time in ISO 8601 format (e.g., ``2025-09-10T19:45:00Z``).
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Returns:
|
||||||
:param nick: nickname of the message sender
|
None
|
||||||
:param message: the message to be sent
|
|
||||||
:param timestamp: time the message was originally sent to the room, in ISO8601 format
|
Example:
|
||||||
:type barejid: str or unicode
|
|
||||||
:type nick: str or unicode
|
::
|
||||||
:type message: str or unicode
|
|
||||||
:type timestamp: str or unicode
|
def prof_on_room_history_message(barejid: str, nick: str, message: str, timestamp: str) -> None:
|
||||||
|
prof.cons_show(f"History in {barejid} from {nick} at {timestamp}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Private Message Handlers
|
||||||
|
# ------------------------
|
||||||
|
|
||||||
def prof_pre_priv_message_display(barejid, nick, message):
|
def prof_pre_priv_message_display(barejid: str, nick: str, message: str) -> str | None:
|
||||||
"""Called before a private chat room message is displayed
|
"""Called before a private chat room message is displayed.
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Allows the plugin to modify or cancel the message display.
|
||||||
:param nick: nickname of message sender
|
|
||||||
:param message: the received message
|
Args:
|
||||||
:type barejid: str or unicode
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:type nick: str or unicode
|
nick: The nickname of the message sender.
|
||||||
:type message: str or unicode
|
message: The received message.
|
||||||
:return: the new message to display, or ``None`` to preserve the original message
|
|
||||||
:rtype: str or unicode
|
Returns:
|
||||||
|
str | None: The modified message to display, or None to preserve the original.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_pre_priv_message_display(barejid: str, nick: str, message: str) -> str | None:
|
||||||
|
return f"{message} (private from {nick})"
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_post_priv_message_display(barejid: str, nick: str, message: str) -> None:
|
||||||
|
"""Called after a private chat room message is displayed.
|
||||||
|
|
||||||
def prof_post_priv_message_display(barejid, nick, message):
|
Use this to perform actions after the message is shown.
|
||||||
"""Called after a private chat room message is displayed
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Args:
|
||||||
:param nick: nickname of the message sender
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:param message: the received message
|
nick: The nickname of the message sender.
|
||||||
:type barejid: str or unicode
|
message: The displayed message.
|
||||||
:type nick: str or unicode
|
|
||||||
:type message: str or unicode
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_post_priv_message_display(barejid: str, nick: str, message: str) -> None:
|
||||||
|
prof.cons_show(f"Displayed private in {barejid} from {nick}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_pre_priv_message_send(barejid: str, nick: str, message: str) -> str | None:
|
||||||
|
"""Called before a private chat room message is sent.
|
||||||
|
|
||||||
def prof_pre_priv_message_send(barejid, nick, message):
|
Allows the plugin to modify or cancel the message.
|
||||||
"""Called before a private chat room message is sent
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Args:
|
||||||
:param nick: nickname of message recipient
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:param message: the message to be sent
|
nick: The nickname of the message recipient.
|
||||||
:type barejid: str or unicode
|
message: The message to be sent.
|
||||||
:type nick: str or unicode
|
|
||||||
:type message: str or unicode
|
Returns:
|
||||||
:return: the modified or original message to send, or ``None`` to cancel sending of the message
|
str | None: The modified message to send, or None to cancel sending.
|
||||||
:rtype: str or unicode
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_pre_priv_message_send(barejid: str, nick: str, message: str) -> str | None:
|
||||||
|
return f"{message} (private to {nick})"
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_post_priv_message_send(barejid: str, nick: str, message: str) -> None:
|
||||||
|
"""Called after a private chat room message is sent.
|
||||||
|
|
||||||
def prof_post_priv_message_send(barejid, nick, message):
|
Use this to log or react to sent messages.
|
||||||
"""Called after a private chat room message has been sent
|
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Args:
|
||||||
:param nick: nickname of the message recipient
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
:param message: the sent message
|
nick: The nickname of the message recipient.
|
||||||
:type barejid: str or unicode
|
message: The sent message.
|
||||||
:type nick: str or unicode
|
|
||||||
:type message: str or unicode
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_post_priv_message_send(barejid: str, nick: str, message: str) -> None:
|
||||||
|
prof.cons_show(f"Sent private to {nick} in {barejid}: {message}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Stanza Handlers
|
||||||
|
# ---------------
|
||||||
|
|
||||||
def prof_on_message_stanza_send(stanza):
|
def prof_on_message_stanza_send(stanza: str) -> str | None:
|
||||||
"""Called before an XMPP message stanza is sent
|
"""Called before an XMPP message stanza is sent.
|
||||||
|
|
||||||
:param stanza: The stanza to send
|
Allows the plugin to modify or cancel the stanza.
|
||||||
:type stanza: str or unicode
|
|
||||||
:return: The new stanza to send, or ``None`` to preserve the original stanza
|
Args:
|
||||||
:rtype: str or unicode
|
stanza: The XMPP message stanza to send.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
str | None: The modified stanza to send, or None to preserve the original.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_message_stanza_send(stanza: str) -> str | None:
|
||||||
|
prof.cons_show(f"Sending message stanza: {stanza}")
|
||||||
|
return stanza
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_message_stanza_receive(stanza: str) -> bool:
|
||||||
|
"""Called when an XMPP message stanza is received.
|
||||||
|
|
||||||
def prof_on_message_stanza_receive(stanza):
|
Allows the plugin to control whether CProof processes the stanza.
|
||||||
"""Called when an XMPP message stanza is received
|
|
||||||
|
|
||||||
:param stanza: The stanza received
|
Args:
|
||||||
:type stanza: str or unicode
|
stanza: The received XMPP message stanza.
|
||||||
:return: ``True`` if Profanity should continue to process the message stanza, ``False`` otherwise
|
|
||||||
:rtype: boolean
|
Returns:
|
||||||
|
bool: True to allow CProof to process the stanza, False to block processing.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_message_stanza_receive(stanza: str) -> bool:
|
||||||
|
prof.cons_show(f"Received message stanza: {stanza}")
|
||||||
|
return True
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_presence_stanza_send(stanza: str) -> str | None:
|
||||||
|
"""Called before an XMPP presence stanza is sent.
|
||||||
|
|
||||||
def prof_on_presence_stanza_send(stanza):
|
Allows the plugin to modify or cancel the stanza.
|
||||||
"""Called before an XMPP presence stanza is sent
|
|
||||||
|
|
||||||
:param stanza: The stanza to send
|
Args:
|
||||||
:type stanza: str or unicode
|
stanza: The XMPP presence stanza to send.
|
||||||
:return: The new stanza to send, or ``None`` to preserve the original stanza
|
|
||||||
:rtype: str or unicode
|
Returns:
|
||||||
|
str | None: The modified stanza to send, or None to preserve the original.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_presence_stanza_send(stanza: str) -> str | None:
|
||||||
|
prof.cons_show(f"Sending presence stanza: {stanza}")
|
||||||
|
return stanza
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_presence_stanza_receive(stanza: str) -> bool:
|
||||||
|
"""Called when an XMPP presence stanza is received.
|
||||||
|
|
||||||
def prof_on_presence_stanza_receive(stanza):
|
Allows the plugin to control whether CProof processes the stanza.
|
||||||
"""Called when an XMPP presence stanza is received
|
|
||||||
|
|
||||||
:param stanza: The stanza received
|
Args:
|
||||||
:type stanza: str or unicode
|
stanza: The received XMPP presence stanza.
|
||||||
:return: ``True`` if Profanity should continue to process the presence stanza, ``False`` otherwise
|
|
||||||
:rtype: boolean
|
Returns:
|
||||||
|
bool: True to allow CProof to process the stanza, False to block processing.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_presence_stanza_receive(stanza: str) -> bool:
|
||||||
|
prof.cons_show(f"Received presence stanza: {stanza}")
|
||||||
|
return True
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_iq_stanza_send(stanza: str) -> str | None:
|
||||||
|
"""Called before an XMPP IQ stanza is sent.
|
||||||
|
|
||||||
def prof_on_iq_stanza_send(stanza):
|
Allows the plugin to modify or cancel the stanza.
|
||||||
"""Called before an XMPP iq stanza is sent
|
|
||||||
|
|
||||||
:param stanza: The stanza to send
|
Args:
|
||||||
:type stanza: str or unicode
|
stanza: The XMPP IQ stanza to send.
|
||||||
:return: The new stanza to send, or ``None`` to preserve the original stanza
|
|
||||||
:rtype: str or unicode
|
Returns:
|
||||||
|
str | None: The modified stanza to send, or None to preserve the original.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_iq_stanza_send(stanza: str) -> str | None:
|
||||||
|
prof.cons_show(f"Sending IQ stanza: {stanza}")
|
||||||
|
return stanza
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_iq_stanza_receive(stanza: str) -> bool:
|
||||||
|
"""Called when an XMPP IQ stanza is received.
|
||||||
|
|
||||||
def prof_on_iq_stanza_receive(stanza):
|
Allows the plugin to control whether CProof processes the stanza.
|
||||||
"""Called when an XMPP iq stanza is received
|
|
||||||
|
|
||||||
:param stanza: The stanza received
|
Args:
|
||||||
:type stanza: str or unicode
|
stanza: The received XMPP IQ stanza.
|
||||||
:return: ``True`` if Profanity should continue to process the iq stanza, ``False`` otherwise
|
|
||||||
:rtype: boolean
|
Returns:
|
||||||
|
bool: True to allow CProof to process the stanza, False to block processing.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_iq_stanza_receive(stanza: str) -> bool:
|
||||||
|
prof.cons_show(f"Received IQ stanza: {stanza}")
|
||||||
|
return True
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Contact Presence Handlers
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
def prof_on_contact_offline(barejid, resource, status):
|
def prof_on_contact_offline(barejid: str, resource: str, status: str | None) -> None:
|
||||||
"""Called when a contact goes offline
|
"""Called when a contact goes offline.
|
||||||
|
|
||||||
:param barejid: Jabber ID of the contact
|
Args:
|
||||||
:param resource: the resource being disconnected
|
barejid: The Jabber ID of the contact (e.g., ``bob@example.com``).
|
||||||
:param status: the status message received with the offline presence, or ``None``
|
resource: The resource being disconnected (e.g., ``laptop``).
|
||||||
:type barejid: str or unicode
|
status: The status message received with the offline presence, or None.
|
||||||
:type resource: str or unicode
|
|
||||||
:type status: str or unicode
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_contact_offline(barejid: str, resource: str, status: str | None) -> None:
|
||||||
|
prof.cons_show(f"{barejid}/{resource} went offline: {status or 'No status'}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_contact_presence(barejid: str, resource: str, presence: str, status: str | None, priority: int) -> None:
|
||||||
|
"""Called when a presence notification is received from a contact.
|
||||||
|
|
||||||
def prof_on_contact_presence(barejid, resource, presence, status, priority):
|
Args:
|
||||||
"""Called when a presence notification is received from a contact
|
barejid: The Jabber ID of the contact (e.g., ``bob@example.com``).
|
||||||
|
resource: The resource of the contact (e.g., ``laptop``).
|
||||||
|
presence: The contact's presence (``"chat"``, ``"online"``, ``"away"``, ``"xa"``, or ``"dnd"``).
|
||||||
|
status: The status message received with the presence, or None.
|
||||||
|
priority: The priority associated with the resource.
|
||||||
|
|
||||||
:param barejid: Jabber ID of the contact
|
Returns:
|
||||||
:param resource: the resource being disconnected
|
None
|
||||||
:param presence: presence of the contact, one of ``"chat"``, ``"online"``, ``"away"``, ``"xa"`` or ``"dnd"``
|
|
||||||
:param status: the status message received with the presence, or ``None``
|
Example:
|
||||||
:param priority: the priority associated with the resource
|
|
||||||
:type barejid: str or unicode
|
::
|
||||||
:type resource: str or unicode
|
|
||||||
:type presence: str or unicode
|
def prof_on_contact_presence(barejid: str, resource: str, presence: str, status: str | None, priority: int) -> None:
|
||||||
:type status: str or unicode
|
prof.notify(f"{barejid} is {presence}", 5000, "Presence")
|
||||||
:type priority: int
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Window Focus Handlers
|
||||||
|
# ---------------------
|
||||||
|
|
||||||
def prof_on_chat_win_focus(barejid):
|
def prof_on_chat_win_focus(barejid: str) -> None:
|
||||||
"""Called when a chat window is focused
|
"""Called when a chat window is focused.
|
||||||
|
|
||||||
:param barejid: Jabber ID of the chat window recipient
|
Args:
|
||||||
:type barejid: str or unicode
|
barejid: The Jabber ID of the chat window recipient (e.g., ``bob@example.com``).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_chat_win_focus(barejid: str) -> None:
|
||||||
|
prof.cons_show(f"Focused chat window for {barejid}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def prof_on_room_win_focus(barejid: str) -> None:
|
||||||
|
"""Called when a chat room window is focused.
|
||||||
|
|
||||||
def prof_on_room_win_focus(barejid):
|
Args:
|
||||||
"""Called when a chat room window is focused
|
barejid: The Jabber ID of the room (e.g., ``chat@conference.example.com``).
|
||||||
|
|
||||||
:param barejid: Jabber ID of the room
|
Returns:
|
||||||
:type barejid: str or unicode
|
None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
def prof_on_room_win_focus(barejid: str) -> None:
|
||||||
|
prof.cons_show(f"Focused room window for {barejid}")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1675,7 +1675,7 @@ char*
|
|||||||
cmd_ac_complete_filepath(const char* const input, char* const startstr, gboolean previous)
|
cmd_ac_complete_filepath(const char* const input, char* const startstr, gboolean previous)
|
||||||
{
|
{
|
||||||
unsigned int output_off = 0;
|
unsigned int output_off = 0;
|
||||||
char* tmp;
|
char* tmp = NULL;
|
||||||
|
|
||||||
// strip command
|
// strip command
|
||||||
char* inpcp = (char*)input + strlen(startstr);
|
char* inpcp = (char*)input + strlen(startstr);
|
||||||
@@ -1687,38 +1687,36 @@ cmd_ac_complete_filepath(const char* const input, char* const startstr, gboolean
|
|||||||
|
|
||||||
// strip quotes
|
// strip quotes
|
||||||
if (*inpcp == '"') {
|
if (*inpcp == '"') {
|
||||||
tmp = strchr(inpcp + 1, '"');
|
tmp = strrchr(inpcp + 1, '"');
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
}
|
}
|
||||||
tmp = strdup(inpcp + 1);
|
tmp = strdup(inpcp + 1);
|
||||||
free(inpcp);
|
free(inpcp);
|
||||||
inpcp = tmp;
|
inpcp = tmp;
|
||||||
|
tmp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// expand ~ to $HOME
|
// expand ~ to $HOME
|
||||||
if (inpcp[0] == '~' && inpcp[1] == '/') {
|
if (inpcp[0] == '~' && inpcp[1] == '/') {
|
||||||
tmp = g_strdup_printf("%s/%sfoo", getenv("HOME"), inpcp + 2);
|
char* home = getenv("HOME");
|
||||||
if (!tmp) {
|
if (!home) {
|
||||||
free(inpcp);
|
free(inpcp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
output_off = strlen(getenv("HOME")) + 1;
|
tmp = g_strdup_printf("%s/%sfoo", home, inpcp + 2);
|
||||||
|
output_off = strlen(home) + 1;
|
||||||
} else {
|
} else {
|
||||||
tmp = g_strdup_printf("%sfoo", inpcp);
|
tmp = g_strdup_printf("%sfoo", inpcp);
|
||||||
if (!tmp) {
|
|
||||||
free(inpcp);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
free(inpcp);
|
free(inpcp);
|
||||||
inpcp = tmp;
|
if (!tmp) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
char* inpcp2 = strdup(inpcp);
|
char* foofile = strdup(basename(tmp));
|
||||||
char* foofile = strdup(basename(inpcp2));
|
char* directory = strdup(dirname(tmp));
|
||||||
char* directory = strdup(dirname(inpcp));
|
g_free(tmp);
|
||||||
free(inpcp);
|
|
||||||
free(inpcp2);
|
|
||||||
|
|
||||||
GArray* files = g_array_new(TRUE, FALSE, sizeof(char*));
|
GArray* files = g_array_new(TRUE, FALSE, sizeof(char*));
|
||||||
g_array_set_clear_func(files, (GDestroyNotify)_filepath_item_free);
|
g_array_set_clear_func(files, (GDestroyNotify)_filepath_item_free);
|
||||||
@@ -1737,40 +1735,26 @@ cmd_ac_complete_filepath(const char* const input, char* const startstr, gboolean
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* acstring;
|
char* acstring = NULL;
|
||||||
if (output_off) {
|
if (output_off) {
|
||||||
tmp = g_strdup_printf("%s/%s", directory, dir->d_name);
|
tmp = g_strdup_printf("%s/%s", directory, dir->d_name);
|
||||||
if (!tmp) {
|
if (tmp) {
|
||||||
free(directory);
|
acstring = g_strdup_printf("~/%s", tmp + output_off);
|
||||||
free(foofile);
|
g_free(tmp);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
acstring = g_strdup_printf("~/%s", tmp + output_off);
|
|
||||||
if (!acstring) {
|
|
||||||
free(directory);
|
|
||||||
free(foofile);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
free(tmp);
|
|
||||||
} else if (strcmp(directory, "/") == 0) {
|
} else if (strcmp(directory, "/") == 0) {
|
||||||
acstring = g_strdup_printf("/%s", dir->d_name);
|
acstring = g_strdup_printf("/%s", dir->d_name);
|
||||||
if (!acstring) {
|
|
||||||
free(directory);
|
|
||||||
free(foofile);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
acstring = g_strdup_printf("%s/%s", directory, dir->d_name);
|
acstring = g_strdup_printf("%s/%s", directory, dir->d_name);
|
||||||
if (!acstring) {
|
}
|
||||||
free(directory);
|
if (!acstring) {
|
||||||
free(foofile);
|
g_array_free(files, TRUE);
|
||||||
return NULL;
|
free(foofile);
|
||||||
}
|
free(directory);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* acstring_cpy = strdup(acstring);
|
g_array_append_val(files, acstring);
|
||||||
g_array_append_val(files, acstring_cpy);
|
|
||||||
free(acstring);
|
|
||||||
}
|
}
|
||||||
closedir(d);
|
closedir(d);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ static const struct cmd_t command_defs[] = {
|
|||||||
{ "<contact>", "The contact you wish to view information about." },
|
{ "<contact>", "The contact you wish to view information about." },
|
||||||
{ "<nick>", "When in a chat room, the occupant you wish to view information about." })
|
{ "<nick>", "When in a chat room, the occupant you wish to view information about." })
|
||||||
CMD_EXAMPLES(
|
CMD_EXAMPLES(
|
||||||
"/info thor@aasgard.server.org",
|
"/info thor@asgard.server.org",
|
||||||
"/info heimdall")
|
"/info heimdall")
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -8577,19 +8577,20 @@ cmd_omemo_trust_mode(ProfWin* window, const char* const command, gchar** args)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_OMEMO
|
#ifdef HAVE_OMEMO
|
||||||
|
|
||||||
|
auto_gchar gchar* trust_mode = prefs_get_string(PREF_OMEMO_TRUST_MODE);
|
||||||
if (!args[1]) {
|
if (!args[1]) {
|
||||||
cons_show("Current trust mode is %s", prefs_get_string(PREF_OMEMO_TRUST_MODE));
|
cons_show("Current trust mode is %s", trust_mode);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_strcmp0(args[1], "manual") == 0) {
|
if (g_strcmp0(args[1], "manual") == 0) {
|
||||||
cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]);
|
cons_show("Current trust mode is %s - setting to %s", trust_mode, args[1]);
|
||||||
cons_show("You need to trust all OMEMO fingerprints manually");
|
cons_show("You need to trust all OMEMO fingerprints manually");
|
||||||
} else if (g_strcmp0(args[1], "firstusage") == 0) {
|
} else if (g_strcmp0(args[1], "firstusage") == 0) {
|
||||||
cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]);
|
cons_show("Current trust mode is %s - setting to %s", trust_mode, args[1]);
|
||||||
cons_show("The first seen OMEMO fingerprints will be trusted automatically - new keys must be trusted manually");
|
cons_show("The first seen OMEMO fingerprints will be trusted automatically - new keys must be trusted manually");
|
||||||
} else if (g_strcmp0(args[1], "blind") == 0) {
|
} else if (g_strcmp0(args[1], "blind") == 0) {
|
||||||
cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]);
|
cons_show("Current trust mode is %s - setting to %s", trust_mode, args[1]);
|
||||||
cons_show("ALL OMEMO fingerprints will be trusted automatically");
|
cons_show("ALL OMEMO fingerprints will be trusted automatically");
|
||||||
} else {
|
} else {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include <curl/easy.h>
|
#include <curl/easy.h>
|
||||||
@@ -199,6 +200,10 @@ load_custom_keyfile(prof_keyfile_t* keyfile, gchar* filename)
|
|||||||
|
|
||||||
if (g_file_test(keyfile->filename, G_FILE_TEST_EXISTS)) {
|
if (g_file_test(keyfile->filename, G_FILE_TEST_EXISTS)) {
|
||||||
g_chmod(keyfile->filename, S_IRUSR | S_IWUSR);
|
g_chmod(keyfile->filename, S_IRUSR | S_IWUSR);
|
||||||
|
} else {
|
||||||
|
int fno = g_creat(keyfile->filename, S_IRUSR | S_IWUSR);
|
||||||
|
if (fno != -1)
|
||||||
|
g_close(fno, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _load_keyfile(keyfile);
|
return _load_keyfile(keyfile);
|
||||||
|
|||||||
@@ -86,10 +86,16 @@ python_get_version_number(void)
|
|||||||
return version_number;
|
return version_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_unref_module(PyObject* module)
|
||||||
|
{
|
||||||
|
Py_XDECREF(module);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
python_env_init(void)
|
python_env_init(void)
|
||||||
{
|
{
|
||||||
loaded_modules = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)Py_XDECREF);
|
loaded_modules = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)_unref_module);
|
||||||
|
|
||||||
python_init_prof();
|
python_init_prof();
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,29 @@ create_input_window(void)
|
|||||||
_inp_win_update_virtual();
|
_inp_win_update_virtual();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_inp_slashguard_check(void)
|
||||||
|
{
|
||||||
|
if (get_password)
|
||||||
|
return false;
|
||||||
|
/* ignore empty and quoted messages */
|
||||||
|
if (inp_line == NULL || inp_line[0] == '\0' || inp_line[0] == '>')
|
||||||
|
return false;
|
||||||
|
if (!prefs_get_boolean(PREF_SLASH_GUARD))
|
||||||
|
return false;
|
||||||
|
size_t n = 1;
|
||||||
|
while (inp_line[n] != '\0' && n < 4) {
|
||||||
|
if (inp_line[n] == '/') {
|
||||||
|
cons_show("Your text contains a slash in the first 4 characters");
|
||||||
|
free(inp_line);
|
||||||
|
inp_line = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
inp_readline(void)
|
inp_readline(void)
|
||||||
{
|
{
|
||||||
@@ -203,17 +226,7 @@ inp_readline(void)
|
|||||||
chat_state_idle();
|
chat_state_idle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inp_line) {
|
if (inp_line && !_inp_slashguard_check()) {
|
||||||
if (!get_password && prefs_get_boolean(PREF_SLASH_GUARD)) {
|
|
||||||
// ignore quoted messages
|
|
||||||
if (strlen(inp_line) > 1 && inp_line[0] != '>') {
|
|
||||||
char* res = (char*)memchr(inp_line + 1, '/', 3);
|
|
||||||
if (res) {
|
|
||||||
cons_show("Your text contains a slash in the first 4 characters");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char* ret = inp_line;
|
char* ret = inp_line;
|
||||||
inp_line = NULL;
|
inp_line = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stddef.h>
|
#include "prof_cmocka.h"
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|||||||
@@ -2,11 +2,8 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <cmocka.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
5
tests/prof_cmocka.h
Normal file
5
tests/prof_cmocka.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#include <stdarg.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
#include <cmocka.h>
|
||||||
@@ -21,8 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <setjmp.h>
|
#include "prof_cmocka.h"
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include <xmpp/xmpp.h>
|
#include <xmpp/xmpp.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "config/account.h"
|
#include "config/account.h"
|
||||||
|
|||||||
@@ -21,8 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <setjmp.h>
|
#include "prof_cmocka.h"
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <setjmp.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <cmocka.h>
|
#include "prof_cmocka.h"
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
@@ -21,8 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <setjmp.h>
|
#include "prof_cmocka.h"
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
#include <libotr/message.h>
|
#include <libotr/message.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include "config/account.h"
|
#include "config/account.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/contact.h"
|
#include "xmpp/contact.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stddef.h>
|
#include "prof_cmocka.h"
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/chat_session.h"
|
#include "xmpp/chat_session.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#include "xmpp/resource.h"
|
#include "xmpp/resource.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stddef.h>
|
#include "prof_cmocka.h"
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/contact.h"
|
#include "xmpp/contact.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include "event/client_events.h"
|
#include "event/client_events.h"
|
||||||
#include "command/cmd_funcs.h"
|
#include "command/cmd_funcs.h"
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stddef.h>
|
#include "prof_cmocka.h"
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/form.h"
|
#include "xmpp/form.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/jid.h"
|
#include "xmpp/jid.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/muc.h"
|
#include "xmpp/muc.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "tools/parser.h"
|
#include "tools/parser.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "plugins/disco.h"
|
#include "plugins/disco.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stddef.h>
|
#include "prof_cmocka.h"
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "xmpp/contact.h"
|
#include "xmpp/contact.h"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
#include <setjmp.h>
|
#include "prof_cmocka.h"
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include "ui/window.h"
|
#include "ui/window.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stddef.h>
|
#include "prof_cmocka.h"
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#include <stdarg.h>
|
#include "prof_cmocka.h"
|
||||||
#include <stddef.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <cmocka.h>
|
|
||||||
|
|
||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user