mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 04:26:20 +00:00
Remove /tiny command
boothj5 gave his okay too. Fix https://github.com/profanity-im/profanity/issues/1370
This commit is contained in:
@@ -64,7 +64,6 @@
|
||||
#include "plugins/plugins.h"
|
||||
#include "tools/autocomplete.h"
|
||||
#include "tools/parser.h"
|
||||
#include "tools/tinyurl.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/window_list.h"
|
||||
#include "xmpp/xmpp.h"
|
||||
@@ -979,22 +978,6 @@ static struct cmd_t command_defs[] = {
|
||||
"/sub request",
|
||||
"/sub sent") },
|
||||
|
||||
{ "/tiny",
|
||||
parse_args, 1, 1, NULL,
|
||||
CMD_NOSUBFUNCS
|
||||
CMD_MAINFUNC(cmd_tiny)
|
||||
CMD_TAGS(
|
||||
CMD_TAG_CHAT,
|
||||
CMD_TAG_GROUPCHAT)
|
||||
CMD_SYN(
|
||||
"/tiny <url>")
|
||||
CMD_DESC(
|
||||
"Send url as tinyurl in current chat.")
|
||||
CMD_ARGS(
|
||||
{ "<url>", "The url to make tiny." })
|
||||
CMD_EXAMPLES(
|
||||
"Example: /tiny https://profanity-im.github.io/") },
|
||||
|
||||
{ "/who",
|
||||
parse_args, 0, 2, NULL,
|
||||
CMD_NOSUBFUNCS
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
#include "tools/http_upload.h"
|
||||
#include "tools/autocomplete.h"
|
||||
#include "tools/parser.h"
|
||||
#include "tools/tinyurl.h"
|
||||
#include "tools/bookmark_ignore.h"
|
||||
#include "plugins/plugins.h"
|
||||
#include "ui/ui.h"
|
||||
@@ -5032,58 +5031,6 @@ cmd_alias(ProfWin* window, const char* const command, gchar** args)
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_tiny(ProfWin* window, const char* const command, gchar** args)
|
||||
{
|
||||
char* url = args[0];
|
||||
|
||||
if (window->type != WIN_CHAT && window->type != WIN_MUC && window->type != WIN_PRIVATE) {
|
||||
cons_show("/tiny can only be used in chat windows");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!tinyurl_valid(url)) {
|
||||
win_println(window, THEME_ERROR, "-", "/tiny, badly formed URL: %s", url);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char* tiny = tinyurl_get(url);
|
||||
if (!tiny) {
|
||||
win_println(window, THEME_ERROR, "-", "Couldn't create tinyurl.");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
switch (window->type) {
|
||||
case WIN_CHAT:
|
||||
{
|
||||
ProfChatWin* chatwin = (ProfChatWin*)window;
|
||||
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
||||
cl_ev_send_msg(chatwin, tiny, NULL);
|
||||
break;
|
||||
}
|
||||
case WIN_PRIVATE:
|
||||
{
|
||||
ProfPrivateWin* privatewin = (ProfPrivateWin*)window;
|
||||
assert(privatewin->memcheck == PROFPRIVATEWIN_MEMCHECK);
|
||||
cl_ev_send_priv_msg(privatewin, tiny, NULL);
|
||||
break;
|
||||
}
|
||||
case WIN_MUC:
|
||||
{
|
||||
ProfMucWin* mucwin = (ProfMucWin*)window;
|
||||
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
|
||||
cl_ev_send_muc_msg(mucwin, tiny, NULL);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
free(tiny);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_clear(ProfWin* window, const char* const command, gchar** args)
|
||||
{
|
||||
|
||||
@@ -128,7 +128,6 @@ gboolean cmd_status_get(ProfWin* window, const char* const command, gchar** args
|
||||
gboolean cmd_status_set(ProfWin* window, const char* const command, gchar** args);
|
||||
gboolean cmd_sub(ProfWin* window, const char* const command, gchar** args);
|
||||
gboolean cmd_theme(ProfWin* window, const char* const command, gchar** args);
|
||||
gboolean cmd_tiny(ProfWin* window, const char* const command, gchar** args);
|
||||
gboolean cmd_wintitle(ProfWin* window, const char* const command, gchar** args);
|
||||
gboolean cmd_vercheck(ProfWin* window, const char* const command, gchar** args);
|
||||
gboolean cmd_who(ProfWin* window, const char* const command, gchar** args);
|
||||
|
||||
Reference in New Issue
Block a user