mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Merge branch 'master' into clear
This commit is contained in:
commit
9905b62804
@ -144,6 +144,13 @@ Retrieve nicknames of all occupants in a chat room, when in a chat room window.
|
|||||||
*/
|
*/
|
||||||
char** prof_get_current_occupants(void);
|
char** prof_get_current_occupants(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieve current nickname used in chat room.
|
||||||
|
@param barejid The room's Jabber ID
|
||||||
|
@return Room nickname.
|
||||||
|
*/
|
||||||
|
char* prof_get_room_nick(const char *barejid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Write to the Profanity log at level DEBUG.
|
Write to the Profanity log at level DEBUG.
|
||||||
@param message The message to log
|
@param message The message to log
|
||||||
@ -326,3 +333,9 @@ If a session is already connected, a presence update will be sent to allow any c
|
|||||||
@param feature the service discovery feature to be added
|
@param feature the service discovery feature to be added
|
||||||
*/
|
*/
|
||||||
void prof_disco_add_feature(char *feature);
|
void prof_disco_add_feature(char *feature);
|
||||||
|
|
||||||
|
/**
|
||||||
|
End any encrypted session with the specified user.
|
||||||
|
@param barejid Jabber ID of the recipient
|
||||||
|
*/
|
||||||
|
void prof_encryption_reset(char *barejid);
|
||||||
|
@ -262,6 +262,14 @@ def get_current_occupants():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def get_room_nick(barejid):
|
||||||
|
"""Retrieve current nickname used in chat room.
|
||||||
|
|
||||||
|
:return: Room nickname.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
def current_win_is_console():
|
def current_win_is_console():
|
||||||
"""Determine whether or not the Console window is currently focussed.
|
"""Determine whether or not the Console window is currently focussed.
|
||||||
|
|
||||||
@ -597,6 +605,7 @@ def incoming_message(barejid, resource, message):
|
|||||||
prof.incoming_message("bob@server.org", "laptop", "Hello there")
|
prof.incoming_message("bob@server.org", "laptop", "Hello there")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def disco_add_feature(feature):
|
def disco_add_feature(feature):
|
||||||
"""Add a service discovery feature the list supported by Profanity.\n
|
"""Add a service discovery feature the list supported by Profanity.\n
|
||||||
If a session is already connected, a presence update will be sent to allow any client/server caches to update their feature list for Profanity
|
If a session is already connected, a presence update will be sent to allow any client/server caches to update their feature list for Profanity
|
||||||
@ -609,3 +618,15 @@ def disco_add_feature(feature):
|
|||||||
prof.disco_add_feature("urn:xmpp:omemo:0:devicelist+notify")
|
prof.disco_add_feature("urn:xmpp:omemo:0:devicelist+notify")
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def encryption_reset(barejid):
|
||||||
|
"""End any encrypted session with the specified user
|
||||||
|
|
||||||
|
:param barejid: Jabber ID of the recipient
|
||||||
|
:type barejid: str or unicode
|
||||||
|
|
||||||
|
Example:
|
||||||
|
::
|
||||||
|
prof.encryption_reset("alice@server.org")
|
||||||
|
"""
|
||||||
|
@ -497,3 +497,29 @@ api_disco_add_feature(char *plugin_name, char *feature)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
api_encryption_reset(const char *const barejid)
|
||||||
|
{
|
||||||
|
if (barejid == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||||
|
if (chatwin == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBGPGME
|
||||||
|
if (chatwin->pgp_send) {
|
||||||
|
chatwin->pgp_send = FALSE;
|
||||||
|
win_println((ProfWin*)chatwin, THEME_DEFAULT, '!', "PGP encryption disabled.");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
|
if (chatwin->is_otr) {
|
||||||
|
chatwin_otr_unsecured(chatwin);
|
||||||
|
otr_end_session(chatwin->barejid);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@ -96,4 +96,6 @@ void api_incoming_message(const char *const barejid, const char *const resource,
|
|||||||
|
|
||||||
void api_disco_add_feature(char *plugin_name, char *feature);
|
void api_disco_add_feature(char *plugin_name, char *feature);
|
||||||
|
|
||||||
|
void api_encryption_reset(const char *const barejid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -341,6 +341,12 @@ c_api_disco_add_feature(const char *filename, char *feature)
|
|||||||
free(plugin_name);
|
free(plugin_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
c_api_encryption_reset(const char *barejid)
|
||||||
|
{
|
||||||
|
api_encryption_reset(barejid);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
c_command_callback(PluginCommand *command, gchar **args)
|
c_command_callback(PluginCommand *command, gchar **args)
|
||||||
{
|
{
|
||||||
@ -408,6 +414,7 @@ c_api_init(void)
|
|||||||
prof_settings_string_list_clear = c_api_settings_string_list_clear;
|
prof_settings_string_list_clear = c_api_settings_string_list_clear;
|
||||||
prof_incoming_message = c_api_incoming_message;
|
prof_incoming_message = c_api_incoming_message;
|
||||||
_prof_disco_add_feature = c_api_disco_add_feature;
|
_prof_disco_add_feature = c_api_disco_add_feature;
|
||||||
|
prof_encryption_reset = c_api_encryption_reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
@ -92,3 +92,5 @@ int (*prof_settings_string_list_clear)(char *group, char *key) = NULL;
|
|||||||
void (*prof_incoming_message)(char *barejid, char *resource, char *message) = NULL;
|
void (*prof_incoming_message)(char *barejid, char *resource, char *message) = NULL;
|
||||||
|
|
||||||
void (*_prof_disco_add_feature)(const char *filename, char *feature) = NULL;
|
void (*_prof_disco_add_feature)(const char *filename, char *feature) = NULL;
|
||||||
|
|
||||||
|
void (*prof_encryption_reset)(const char *barejid) = NULL;
|
||||||
|
@ -105,4 +105,6 @@ void (*prof_incoming_message)(char *barejid, char *resource, char *message);
|
|||||||
|
|
||||||
void (*_prof_disco_add_feature)(const char *filename, char *feature);
|
void (*_prof_disco_add_feature)(const char *filename, char *feature);
|
||||||
|
|
||||||
|
void (*prof_encryption_reset)(const char *barejid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1031,6 +1031,24 @@ python_api_disco_add_feature(PyObject *self, PyObject *args)
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject*
|
||||||
|
python_api_encryption_reset(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
PyObject *barejid = NULL;
|
||||||
|
if (!PyArg_ParseTuple(args, "O", &barejid)) {
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *barejid_str = python_str_or_unicode_to_string(barejid);
|
||||||
|
|
||||||
|
allow_python_threads();
|
||||||
|
api_encryption_reset(barejid_str);
|
||||||
|
free(barejid_str);
|
||||||
|
disable_python_threads();
|
||||||
|
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
python_command_callback(PluginCommand *command, gchar **args)
|
python_command_callback(PluginCommand *command, gchar **args)
|
||||||
{
|
{
|
||||||
@ -1139,6 +1157,7 @@ static PyMethodDef apiMethods[] = {
|
|||||||
{ "settings_string_list_clear", python_api_settings_string_list_clear, METH_VARARGS, "Remove all items from string list setting." },
|
{ "settings_string_list_clear", python_api_settings_string_list_clear, METH_VARARGS, "Remove all items from string list setting." },
|
||||||
{ "incoming_message", python_api_incoming_message, METH_VARARGS, "Show an incoming message." },
|
{ "incoming_message", python_api_incoming_message, METH_VARARGS, "Show an incoming message." },
|
||||||
{ "disco_add_feature", python_api_disco_add_feature, METH_VARARGS, "Add a feature to disco info response." },
|
{ "disco_add_feature", python_api_disco_add_feature, METH_VARARGS, "Add a feature to disco info response." },
|
||||||
|
{ "encryption_reset", python_api_encryption_reset, METH_VARARGS, "End encrypted chat session with barejid, if one exists" },
|
||||||
{ NULL, NULL, 0, NULL }
|
{ NULL, NULL, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user