mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Show info in chat and private chat windows
This commit is contained in:
parent
c65b43f081
commit
1925cb80ec
@ -1402,28 +1402,16 @@ cmd_info(gchar **args, struct cmd_help_t help)
|
|||||||
break;
|
break;
|
||||||
case WIN_CHAT:
|
case WIN_CHAT:
|
||||||
if (usr != NULL) {
|
if (usr != NULL) {
|
||||||
cons_show("No parameter required for /info in chat.");
|
ui_current_print_line("No parameter required when in chat.");
|
||||||
} else {
|
} else {
|
||||||
pcontact = roster_get_contact(recipient);
|
ui_info();
|
||||||
if (pcontact != NULL) {
|
|
||||||
cons_show_info(pcontact);
|
|
||||||
} else {
|
|
||||||
cons_show("No such contact \"%s\" in roster.", recipient);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIN_PRIVATE:
|
case WIN_PRIVATE:
|
||||||
if (usr != NULL) {
|
if (usr != NULL) {
|
||||||
ui_current_print_line("No parameter required when in chat.");
|
ui_current_print_line("No parameter required when in chat.");
|
||||||
} else {
|
} else {
|
||||||
Jid *jid = jid_create(recipient);
|
ui_info_private();
|
||||||
pcontact = muc_get_participant(jid->barejid, jid->resourcepart);
|
|
||||||
if (pcontact != NULL) {
|
|
||||||
cons_show_info(pcontact);
|
|
||||||
} else {
|
|
||||||
cons_show("No such participant \"%s\" in room.", jid->resourcepart);
|
|
||||||
}
|
|
||||||
jid_destroy(jid);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIN_CONSOLE:
|
case WIN_CONSOLE:
|
||||||
|
@ -1804,6 +1804,20 @@ _ui_status(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ui_info(void)
|
||||||
|
{
|
||||||
|
char *recipient = ui_current_recipient();
|
||||||
|
PContact pcontact = roster_get_contact(recipient);
|
||||||
|
ProfWin *current = wins_get_current();
|
||||||
|
|
||||||
|
if (pcontact != NULL) {
|
||||||
|
win_show_info(current, pcontact);
|
||||||
|
} else {
|
||||||
|
win_print_line(current, '-', 0, "Error getting contact info.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ui_status_private(void)
|
_ui_status_private(void)
|
||||||
{
|
{
|
||||||
@ -1820,6 +1834,22 @@ _ui_status_private(void)
|
|||||||
jid_destroy(jid);
|
jid_destroy(jid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ui_info_private(void)
|
||||||
|
{
|
||||||
|
Jid *jid = jid_create(ui_current_recipient());
|
||||||
|
PContact pcontact = muc_get_participant(jid->barejid, jid->resourcepart);
|
||||||
|
ProfWin *current = wins_get_current();
|
||||||
|
|
||||||
|
if (pcontact != NULL) {
|
||||||
|
win_show_info(current, pcontact);
|
||||||
|
} else {
|
||||||
|
win_print_line(current, '-', 0, "Error getting contact info.");
|
||||||
|
}
|
||||||
|
|
||||||
|
jid_destroy(jid);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_ui_status_room(const char * const contact)
|
_ui_status_room(const char * const contact)
|
||||||
{
|
{
|
||||||
@ -2172,7 +2202,9 @@ ui_init_module(void)
|
|||||||
ui_room_subject = _ui_room_subject;
|
ui_room_subject = _ui_room_subject;
|
||||||
ui_room_broadcast = _ui_room_broadcast;
|
ui_room_broadcast = _ui_room_broadcast;
|
||||||
ui_status = _ui_status;
|
ui_status = _ui_status;
|
||||||
|
ui_info = _ui_info;
|
||||||
ui_status_private = _ui_status_private;
|
ui_status_private = _ui_status_private;
|
||||||
|
ui_info_private = _ui_info_private;
|
||||||
ui_status_room = _ui_status_room;
|
ui_status_room = _ui_status_room;
|
||||||
ui_info_room = _ui_info_room;
|
ui_info_room = _ui_info_room;
|
||||||
ui_unread = _ui_unread;
|
ui_unread = _ui_unread;
|
||||||
|
@ -153,7 +153,9 @@ void (*ui_handle_room_join_error)(const char * const room, const char * const er
|
|||||||
void (*ui_status_room)(const char * const contact);
|
void (*ui_status_room)(const char * const contact);
|
||||||
void (*ui_info_room)(const char * const contact);
|
void (*ui_info_room)(const char * const contact);
|
||||||
void (*ui_status)(void);
|
void (*ui_status)(void);
|
||||||
|
void (*ui_info)(void);
|
||||||
void (*ui_status_private)(void);
|
void (*ui_status_private)(void);
|
||||||
|
void (*ui_info_private)(void);
|
||||||
|
|
||||||
void (*ui_create_duck_win)(void);
|
void (*ui_create_duck_win)(void);
|
||||||
void (*ui_open_duck_win)(void);
|
void (*ui_open_duck_win)(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user