mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Change nick to name in api to match convention
Change all instances of *get_nick_from_roster to *get_name_from_roster to match the convention of names in the roster itself.
This commit is contained in:
parent
ed4d2fcfb2
commit
802442fffc
@ -142,7 +142,7 @@ char* prof_get_current_nick(void);
|
|||||||
Retrieve the nickname for a given barejid if it is in the roster.
|
Retrieve the nickname for a given barejid if it is in the roster.
|
||||||
@return the users nickname e.g. "eddie", or NULLL if the barejid is not in the roster.
|
@return the users nickname e.g. "eddie", or NULLL if the barejid is not in the roster.
|
||||||
*/
|
*/
|
||||||
char* prof_get_nick_from_roster(const char *barejid);
|
char* prof_get_name_from_roster(const char *barejid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieve nicknames of all occupants in a chat room, when in a chat room window.
|
Retrieve nicknames of all occupants in a chat room, when in a chat room window.
|
||||||
|
@ -253,7 +253,7 @@ def get_current_nick():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_nick_from_roster(barejid):
|
def get_name_from_roster(barejid):
|
||||||
"""Retrieve a nickname from a barejid if it is in the roster.
|
"""Retrieve a nickname from a barejid if it is in the roster.
|
||||||
|
|
||||||
:return: the users nickname e.g. ``"eddie"``, or ``None`` if the barejid is not in the roster.
|
:return: the users nickname e.g. ``"eddie"``, or ``None`` if the barejid is not in the roster.
|
||||||
|
@ -241,7 +241,7 @@ api_get_current_nick(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
api_get_nick_from_roster(const char* barejid)
|
api_get_name_from_roster(const char* barejid)
|
||||||
{
|
{
|
||||||
return roster_get_display_name(barejid);
|
return roster_get_display_name(barejid);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ char* api_get_current_recipient(void);
|
|||||||
char* api_get_current_muc(void);
|
char* api_get_current_muc(void);
|
||||||
gboolean api_current_win_is_console(void);
|
gboolean api_current_win_is_console(void);
|
||||||
char* api_get_current_nick(void);
|
char* api_get_current_nick(void);
|
||||||
char* api_get_nick_from_roster(const char* barejid);
|
char* api_get_name_from_roster(const char* barejid);
|
||||||
char** api_get_current_occupants(void);
|
char** api_get_current_occupants(void);
|
||||||
|
|
||||||
char* api_get_room_nick(const char* barejid);
|
char* api_get_room_nick(const char* barejid);
|
||||||
|
@ -196,9 +196,9 @@ c_api_get_current_nick(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
c_api_get_nick_from_roster(const char* barejid)
|
c_api_get_name_from_roster(const char* barejid)
|
||||||
{
|
{
|
||||||
return api_get_nick_from_roster(barejid);
|
return api_get_name_from_roster(barejid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char**
|
static char**
|
||||||
@ -489,7 +489,7 @@ c_api_init(void)
|
|||||||
prof_get_current_muc = c_api_get_current_muc;
|
prof_get_current_muc = c_api_get_current_muc;
|
||||||
prof_current_win_is_console = c_api_current_win_is_console;
|
prof_current_win_is_console = c_api_current_win_is_console;
|
||||||
prof_get_current_nick = c_api_get_current_nick;
|
prof_get_current_nick = c_api_get_current_nick;
|
||||||
prof_get_nick_from_roster = c_api_get_nick_from_roster;
|
prof_get_name_from_roster = c_api_get_name_from_roster;
|
||||||
prof_get_current_occupants = c_api_get_current_occupants;
|
prof_get_current_occupants = c_api_get_current_occupants;
|
||||||
prof_get_room_nick = c_api_get_room_nick;
|
prof_get_room_nick = c_api_get_room_nick;
|
||||||
prof_log_debug = c_api_log_debug;
|
prof_log_debug = c_api_log_debug;
|
||||||
|
@ -64,7 +64,7 @@ char* (*prof_get_current_recipient)(void) = NULL;
|
|||||||
char* (*prof_get_current_muc)(void) = NULL;
|
char* (*prof_get_current_muc)(void) = NULL;
|
||||||
int (*prof_current_win_is_console)(void) = NULL;
|
int (*prof_current_win_is_console)(void) = NULL;
|
||||||
char* (*prof_get_current_nick)(void) = NULL;
|
char* (*prof_get_current_nick)(void) = NULL;
|
||||||
char* (*prof_get_nick_from_roster)(const char *barejid) = NULL;
|
char* (*prof_get_name_from_roster)(const char *barejid) = NULL;
|
||||||
char** (*prof_get_current_occupants)(void) = NULL;
|
char** (*prof_get_current_occupants)(void) = NULL;
|
||||||
|
|
||||||
char* (*prof_get_room_nick)(const char *barejid) = NULL;
|
char* (*prof_get_room_nick)(const char *barejid) = NULL;
|
||||||
|
@ -74,7 +74,7 @@ char* (*prof_get_current_recipient)(void);
|
|||||||
char* (*prof_get_current_muc)(void);
|
char* (*prof_get_current_muc)(void);
|
||||||
int (*prof_current_win_is_console)(void);
|
int (*prof_current_win_is_console)(void);
|
||||||
char* (*prof_get_current_nick)(void);
|
char* (*prof_get_current_nick)(void);
|
||||||
char* (*prof_get_nick_from_roster)(const char *barejid);
|
char* (*prof_get_name_from_roster)(const char *barejid);
|
||||||
char** (*prof_get_current_occupants)(void);
|
char** (*prof_get_current_occupants)(void);
|
||||||
|
|
||||||
char* (*prof_get_room_nick)(const char *barejid);
|
char* (*prof_get_room_nick)(const char *barejid);
|
||||||
|
@ -442,7 +442,7 @@ python_api_get_current_nick(PyObject* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
python_api_get_nick_from_roster(PyObject* self, PyObject* args)
|
python_api_get_name_from_roster(PyObject* self, PyObject* args)
|
||||||
{
|
{
|
||||||
PyObject* barejid = NULL;
|
PyObject* barejid = NULL;
|
||||||
if (!PyArg_ParseTuple(args, "O", &barejid)) {
|
if (!PyArg_ParseTuple(args, "O", &barejid)) {
|
||||||
@ -452,11 +452,11 @@ python_api_get_nick_from_roster(PyObject* self, PyObject* args)
|
|||||||
char* barejid_str = python_str_or_unicode_to_string(barejid);
|
char* barejid_str = python_str_or_unicode_to_string(barejid);
|
||||||
|
|
||||||
allow_python_threads();
|
allow_python_threads();
|
||||||
char* nick = roster_get_display_name(barejid_str);
|
char* name = roster_get_display_name(barejid_str);
|
||||||
free(barejid_str);
|
free(barejid_str);
|
||||||
disable_python_threads();
|
disable_python_threads();
|
||||||
if (nick) {
|
if (name) {
|
||||||
return Py_BuildValue("s", nick);
|
return Py_BuildValue("s", name);
|
||||||
} else {
|
} else {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
@ -1509,7 +1509,7 @@ static PyMethodDef apiMethods[] = {
|
|||||||
{ "get_current_recipient", python_api_get_current_recipient, METH_VARARGS, "Return the jid of the recipient of the current window." },
|
{ "get_current_recipient", python_api_get_current_recipient, METH_VARARGS, "Return the jid of the recipient of the current window." },
|
||||||
{ "get_current_muc", python_api_get_current_muc, METH_VARARGS, "Return the jid of the room of the current window." },
|
{ "get_current_muc", python_api_get_current_muc, METH_VARARGS, "Return the jid of the room of the current window." },
|
||||||
{ "get_current_nick", python_api_get_current_nick, METH_VARARGS, "Return nickname in current room." },
|
{ "get_current_nick", python_api_get_current_nick, METH_VARARGS, "Return nickname in current room." },
|
||||||
{ "get_nick_from_roster", python_api_get_nick_from_roster, METH_VARARGS, "Return nickname in roster of barejid." },
|
{ "get_name_from_roster", python_api_get_name_from_roster, METH_VARARGS, "Return nickname in roster of barejid." },
|
||||||
{ "get_current_occupants", python_api_get_current_occupants, METH_VARARGS, "Return list of occupants in current room." },
|
{ "get_current_occupants", python_api_get_current_occupants, METH_VARARGS, "Return list of occupants in current room." },
|
||||||
{ "current_win_is_console", python_api_current_win_is_console, METH_VARARGS, "Returns whether the current window is the console." },
|
{ "current_win_is_console", python_api_current_win_is_console, METH_VARARGS, "Returns whether the current window is the console." },
|
||||||
{ "get_room_nick", python_api_get_room_nick, METH_VARARGS, "Return the nickname used in the specified room, or None if not in the room." },
|
{ "get_room_nick", python_api_get_room_nick, METH_VARARGS, "Return the nickname used in the specified room, or None if not in the room." },
|
||||||
|
Loading…
Reference in New Issue
Block a user