From 4d51c8451c6abb2fa90e099034fcc9c39e7530aa Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 9 Jul 2017 00:10:53 -0300 Subject: configure: Don't require python if docs are already built --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 7cb15440..afb77459 100755 --- a/configure +++ b/configure @@ -769,7 +769,7 @@ fi if [ "$doc" = "1" ]; then # check this here just in case someone tries to install it in python2.4... - if ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then + if [ ! -e $srcdir/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then echo echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' echo "(Use the PYTHON environment variable if it's in a weird location)" -- cgit v1.2.3 From a9e0de25139d71ddb979d053049b32803a97dbbc Mon Sep 17 00:00:00 2001 From: dequis Date: Wed, 12 Jul 2017 19:53:29 -0300 Subject: purple: enable debug during core initialization Noisy but often important --- protocols/purple/purple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 0b74c8d8..5d935028 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -1794,6 +1794,7 @@ void purple_initmodule() GList *prots; GString *help; char *dir; + gboolean debug_enabled = !!getenv("BITLBEE_DEBUG"); if (purple_get_core() != NULL) { log_message(LOGLVL_ERROR, "libpurple already initialized. " @@ -1812,7 +1813,7 @@ void purple_initmodule() purple_plugins_add_search_path(dir); g_free(dir); - purple_debug_set_enabled(FALSE); + purple_debug_set_enabled(debug_enabled); purple_core_set_ui_ops(&bee_core_uiops); purple_eventloop_set_ui_ops(&glib_eventloops); if (!purple_core_init("BitlBee")) { @@ -1820,6 +1821,7 @@ void purple_initmodule() fprintf(stderr, "libpurple initialization failed.\n"); abort(); } + purple_debug_set_enabled(FALSE); if (proxytype != PROXY_NONE) { PurpleProxyInfo *pi = purple_global_proxy_get_info(); -- cgit v1.2.3 From d11822ad2ff37193c8a5c6fc34d8c175e2281efc Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 9 Aug 2017 07:55:15 +0200 Subject: Twitter: fix format strings for integers Silence the following compiler warning: format specifies type 'unsigned long long' but the argument has type 'guint64'. When formatting a json_integer, use PRId64 for int64_t. When formatting ordinary integers, use G_GUINT64_FORMAT for guint64. --- protocols/twitter/twitter_lib.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 761d74f7..8425c58e 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -307,7 +307,7 @@ static gboolean twitter_xt_get_friends_id_list(json_value *node, struct twitter_ } txl->list = g_slist_prepend(txl->list, - g_strdup_printf("%" PRIu64, c->u.array.values[i]->u.integer)); + g_strdup_printf("%" PRId64, c->u.array.values[i]->u.integer)); } c = json_o_get(node, "next_cursor"); @@ -440,7 +440,7 @@ static void twitter_http_get_noretweets_ids(struct http_request *req) txl = g_new0(struct twitter_xml_list, 1); txl->list = td->noretweets_ids; - + // Process the retweet ids txl->type = TXL_ID; if (parsed->type == json_array) { @@ -451,7 +451,7 @@ static void twitter_http_get_noretweets_ids(struct http_request *req) continue; } txl->list = g_slist_prepend(txl->list, - g_strdup_printf("%"PRIu64, c->u.integer)); + g_strdup_printf("%" PRId64, c->u.integer)); } } @@ -749,7 +749,7 @@ static void expand_entities(char **text, const json_value *node, const json_valu const char *full = json_o_str(v->u.array.values[i], "expanded_url"); char *pos, *new; - /* Skip if a required field is missing, if the t.co URL is not in fact + /* Skip if a required field is missing, if the t.co URL is not in fact in the Tweet at all, or if the full-ish one *is* in it already (dupes appear, especially in streaming API). */ if (!kort || !disp || !(pos = strstr(*text, kort)) || strstr(*text, disp)) { @@ -977,9 +977,9 @@ static void twitter_status_show(struct im_connection *ic, struct twitter_xml_sta if (status->user == NULL || status->text == NULL) { return; } - + /* Check this is not a tweet that should be muted */ - uid_str = g_strdup_printf("%" PRIu64, status->user->uid); + uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, status->user->uid); if (g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp)) { g_free(uid_str); @@ -1169,21 +1169,21 @@ static gboolean twitter_stream_handle_event(struct im_connection *ic, json_value GSList *found; char *uid_str; ut = twitter_xt_get_user(target); - uid_str = g_strdup_printf("%" PRIu64, ut->uid); + uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, ut->uid); if (!(found = g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp))) { td->mutes_ids = g_slist_prepend(td->mutes_ids, uid_str); } twitter_log(ic, "Muted user %s", ut->screen_name); if (getenv("BITLBEE_DEBUG")) { - fprintf(stderr, "New mute: %s %"PRIu64"\n", + fprintf(stderr, "New mute: %s %"G_GUINT64_FORMAT"\n", ut->screen_name, ut->uid); } } else if (strcmp(type, "unmute") == 0) { GSList *found; char *uid_str; ut = twitter_xt_get_user(target); - uid_str = g_strdup_printf("%" PRIu64, ut->uid); + uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, ut->uid); if ((found = g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp))) { char *found_str = found->data; @@ -1193,7 +1193,7 @@ static gboolean twitter_stream_handle_event(struct im_connection *ic, json_value g_free(uid_str); twitter_log(ic, "Unmuted user %s", ut->screen_name); if (getenv("BITLBEE_DEBUG")) { - fprintf(stderr, "New unmute: %s %"PRIu64"\n", + fprintf(stderr, "New unmute: %s %"G_GUINT64_FORMAT"\n", ut->screen_name, ut->uid); } } -- cgit v1.2.3 From a89327153865493f5a86cb6a4b005f150a54cb3b Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 9 Aug 2017 08:36:20 +0200 Subject: Twitter documentation: move commands to a chapter The Twitter commands are now documented in their own chapter accessed by `help twitter` instead of being hidden in `help set commands`. --- doc/user-guide/Makefile | 2 +- doc/user-guide/commands.xml | 19 +------------------ doc/user-guide/help.xml | 1 + doc/user-guide/twitter.xml | 28 ++++++++++++++++++++++++++++ doc/user-guide/user-guide.xml | 1 + 5 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 doc/user-guide/twitter.xml diff --git a/doc/user-guide/Makefile b/doc/user-guide/Makefile index 01fd9aa2..541d8c46 100644 --- a/doc/user-guide/Makefile +++ b/doc/user-guide/Makefile @@ -34,7 +34,7 @@ help.xml: commands.xml %.db.xml: %.xml docbook.xsl xsltproc --xinclude --output $@ docbook.xsl $< -help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml +help.txt: $(_SRCDIR_)help.xml $(_SRCDIR_)commands.xml $(_SRCDIR_)misc.xml $(_SRCDIR_)quickstart.xml $(_SRCDIR_)twitter.xml $(PYTHON) $(_SRCDIR_)genhelp.py $< $@ clean: diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 1ddf9764..b21f75a2 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -890,24 +890,7 @@ - With this setting enabled, you can use some commands in your Twitter channel/query. The commands are simple and not documented in too much detail: - - - - undo #[<id>]Delete your last Tweet (or one with the given ID) - rt <screenname|#id>Retweet someone's last Tweet (or one with the given ID) - reply <screenname|#id>Reply to a Tweet (with a reply-to reference) - rawreply <screenname|#id>Reply to a Tweet (with no reply-to reference) - report <screenname|#id>Report the given user (or the user who posted the tweet with the given ID) for sending spam. This will also block them. - follow <screenname>Start following a person - unfollow <screenname>Stop following a person - favourite <screenname|#id>Favourite the given user's most recent tweet, or the given tweet ID. - post <message>Post a tweet - url <screenname|#id>Show URL for a tweet to open it in a browser (and see context) - - - - Anything that doesn't look like a command will be treated as a tweet. Watch out for typos, or to avoid this behaviour, you can set this setting to strict, which causes the post command to become mandatory for posting a tweet. + With this setting enabled, you can use some commands in your Twitter channel/query. See help twitter for the list of extra commands available. diff --git a/doc/user-guide/help.xml b/doc/user-guide/help.xml index 1b68413a..810731b5 100644 --- a/doc/user-guide/help.xml +++ b/doc/user-guide/help.xml @@ -59,6 +59,7 @@ You can read more about them with help <subject> + diff --git a/doc/user-guide/twitter.xml b/doc/user-guide/twitter.xml new file mode 100644 index 00000000..3827464a --- /dev/null +++ b/doc/user-guide/twitter.xml @@ -0,0 +1,28 @@ + +Twitter + + +Twitter allows you to use a set of commands in the Twitter channel/query. See help set commands. + + + +Anything that doesn't look like a command will be treated as a new message. Watch out for typos, or to avoid this behaviour, set the commands setting to strict, which causes the post command to become mandatory for posting. See help set commands. + + + +Here is a short description of the commands available: + +undo [<#id>]Delete your last message (or one with the given ID) +rt <screenname|#id>Retweet someone's last message (or one with the given ID) +reply <screenname|#id>Reply to a message (with a reply-to reference) +rawreply <screenname|#id>Reply to a message (with no reply-to reference) +report <screenname|#id>Report the given user (or the user who posted the message with the given ID) for sending spam. This will also block them. +follow <screenname>Start following a person +unfollow <screenname>Stop following a person +favourite <screenname|#id>Favourite the given user's most recent message, or the given ID. +post <message>Post a message +url <screenname|#id>Show URL for a message to open it in a browser (and see context) + + + + diff --git a/doc/user-guide/user-guide.xml b/doc/user-guide/user-guide.xml index 5e1c8fe0..16b974db 100644 --- a/doc/user-guide/user-guide.xml +++ b/doc/user-guide/user-guide.xml @@ -36,6 +36,7 @@ + -- cgit v1.2.3 From af6b7fa14a1362c8f12e07360a4cd011dd07c542 Mon Sep 17 00:00:00 2001 From: Jesse Kennedy Date: Wed, 16 Aug 2017 15:36:08 -0700 Subject: channel operates on channel ids not account ids --- doc/user-guide/commands.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index b21f75a2..f20e3298 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -183,7 +183,7 @@ Channel list maintenance - channel [<account id>] <action> [<arguments>] + channel [<channel id>] <action> [<arguments>] -- cgit v1.2.3 From ad66dcd65ee6e84f25fdb46956df0ad3041d0ced Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Thu, 31 Aug 2017 22:00:19 +0200 Subject: Add datadir to pkgconfig file and config.h Export datadir through pkgconfig and config.h for later use by plugins. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index afb77459..e2357815 100755 --- a/configure +++ b/configure @@ -246,6 +246,7 @@ cat<config.h #define ETCDIR "$etcdir" #define VARDIR "$datadir" #define PLUGINDIR "$plugindir" +#define DATADIR "$datadir" #define PIDFILE "$pidfile" #define IPCSOCKET "$ipcsocket" EOF @@ -813,6 +814,7 @@ prefix=$prefix includedir=$includedir plugindir=$plugindir libdir=$libdir +datadir=$datadir Name: bitlbee Description: IRC to IM gateway -- cgit v1.2.3