diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2013-01-05 13:47:56 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2013-01-05 13:47:56 +0000 |
commit | 62a2bf92daff0756244feb3940eeb46b66ebce6f (patch) | |
tree | e3cd8e14350a6101a2efde80c35d8fa6e8e96f83 | |
parent | e6298e5a2b57a12ff0a10e15030823af89c734cb (diff) | |
parent | 757e1e0fdd0d80818a480d507e41b5a8e32ceb3e (diff) |
Merge from vmiklos.
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | lib/json.c | 4 | ||||
-rw-r--r-- | protocols/skype/HACKING | 8 | ||||
-rw-r--r-- | protocols/skype/Makefile | 75 | ||||
-rw-r--r-- | protocols/skype/README | 10 | ||||
-rw-r--r-- | protocols/skype/asciidoc.conf | 7 | ||||
-rw-r--r-- | protocols/skype/skype.c | 69 | ||||
-rw-r--r-- | protocols/skype/skyped.txt | 2 |
8 files changed, 56 insertions, 122 deletions
@@ -54,6 +54,9 @@ Makefile.settings: clean: $(subdirs) rm -f *.o $(OUTFILE) core utils/bitlbeed init/bitlbee*.service $(MAKE) -C tests clean +ifdef SKYPE_PI + $(MAKE) -C protocols/skype clean +endif distclean: clean $(subdirs) rm -rf .depend @@ -212,8 +212,8 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch { json_uchar uchar; unsigned char uc_b1, uc_b2, uc_b3, uc_b4; - json_char * string; - unsigned int string_length; + json_char * string = 0; + unsigned int string_length = 0; top = root = 0; flags = flag_seek_value; diff --git a/protocols/skype/HACKING b/protocols/skype/HACKING index f5516832..68ea44e8 100644 --- a/protocols/skype/HACKING +++ b/protocols/skype/HACKING @@ -16,11 +16,3 @@ run python skyped.py -n -d 4) irssi - -== Get the code from git - -To get the code directly from git, you need: - -git clone git://vmiklos.hu/bitlbee-skype -cd bitlbee-skype -make autogen diff --git a/protocols/skype/Makefile b/protocols/skype/Makefile index 455a21f2..8bd3464f 100644 --- a/protocols/skype/Makefile +++ b/protocols/skype/Makefile @@ -3,10 +3,7 @@ ifdef _SRCDIR_ _SRCDIR_ := $(_SRCDIR_)protocols/skype/ endif -VERSION = 0.9.0 DATE := $(shell date +%Y-%m-%d) -# latest stable -BITLBEE_VERSION = 3.0.1 INSTALL = install ASCIIDOC = yes @@ -16,70 +13,18 @@ else MANPAGES = endif -ifeq ($(BITLBEE),yes) -LIBS = skype.$(SHARED_EXT) -else -LIBS = -endif - -all: $(LIBS) $(MANPAGES) - -skype.$(SHARED_EXT): $(_SRCDIR_)skype.c config.mak -ifeq ($(BITLBEE),yes) - $(CC) $(CFLAGS) $(SHARED_FLAGS) -o skype.$(SHARED_EXT) $(_SRCDIR_)skype.c $(LDFLAGS) -endif - -install: all install-doc -ifeq ($(BITLBEE),yes) - $(INSTALL) -d $(DESTDIR)$(plugindir) - $(INSTALL) skype.$(SHARED_EXT) $(DESTDIR)$(plugindir) -endif -ifeq ($(SKYPE4PY),yes) - $(INSTALL) -d $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(sysconfdir) - $(INSTALL) skyped.py $(DESTDIR)$(bindir)/skyped - perl -p -i -e 's|/usr/local/etc/skyped|$(sysconfdir)|' $(DESTDIR)$(bindir)/skyped - $(INSTALL) -m644 skyped.conf.dist $(DESTDIR)$(sysconfdir)/skyped.conf - perl -p -i -e 's|\$${prefix}|$(prefix)|' $(DESTDIR)$(sysconfdir)/skyped.conf - $(INSTALL) -m644 skyped.cnf $(DESTDIR)$(sysconfdir) -endif - -client: $(_SRCDIR_)client.c - -autogen: configure.ac - cp $(shell ls /usr/share/automake-*/install-sh | tail -n1) ./ - autoconf +all: $(MANPAGES) clean: - rm -f $(LIBS) $(MANPAGES) - -distclean: clean - rm -f config.log config.mak config.status $(MANPAGES) - -autoclean: distclean - rm -rf aclocal.m4 autom4te.cache configure install-sh + rm -f $(MANPAGES) # take this from the kernel check: - perl checkpatch.pl --no-tree --file skype.c + perl checkpatch.pl --show-types --ignore LONG_LINE,CAMELCASE --no-tree --file skype.c test: all $(MAKE) -C t/ all -dist: - git archive --format=tar --prefix=bitlbee-skype-$(VERSION)/ HEAD | tar xf - - mkdir -p bitlbee-skype-$(VERSION) - git log --no-merges |git name-rev --tags --stdin > bitlbee-skype-$(VERSION)/Changelog - make -C bitlbee-skype-$(VERSION) autogen - tar czf bitlbee-skype-$(VERSION).tar.gz bitlbee-skype-$(VERSION) - rm -rf bitlbee-skype-$(VERSION) - -release: - git tag $(VERSION) - $(MAKE) dist - gpg --comment "See http://vmiklos.hu/gpg/ for info" \ - -ba bitlbee-skype-$(VERSION).tar.gz - doc: $(MANPAGES) install-doc: doc @@ -91,17 +36,5 @@ endif uninstall-doc: rm -f $(DESTDIR)$(MANDIR)/man1/skyped.1* -HEADER.html: README Makefile - asciidoc -a toc -a numbered -a sectids -o HEADER.html -a icons -a data-uri --attribute iconsdir=./images/icons README - sed -i 's|@VERSION@|$(VERSION)|g' HEADER.html - sed -i 's|@BITLBEE_VERSION@|$(BITLBEE_VERSION)|g' HEADER.html - -Changelog: .git/refs/heads/master - git log --no-merges |git name-rev --tags --stdin >Changelog - -AUTHORS: .git/refs/heads/master - git shortlog -s -n |sed 's/.*\t//'> AUTHORS - %.1: $(_SRCDIR_)%.txt $(_SRCDIR_)asciidoc.conf - a2x --asciidoc-opts="-f $(_SRCDIR_)asciidoc.conf" \ - -a bs_version=$(VERSION) -a bs_date=$(DATE) -f manpage -D . $< + a2x --asciidoc-opts="-f $(_SRCDIR_)asciidoc.conf" -a bee_date=$(DATE) -f manpage -D . $< diff --git a/protocols/skype/README b/protocols/skype/README index 95ac0475..06e608ff 100644 --- a/protocols/skype/README +++ b/protocols/skype/README @@ -346,9 +346,10 @@ $ skyped -n -d * `account skype set test_join true` -- Mood texts are not shown by default. If you want to see it: +- Mood texts are not shown by default. - * `account skype set show_moods true` + * If you want to see them: `account skype set show_moods true` + * If you want to change your mood text: `account skype set mood_text 'foo bar'` - Group support: @@ -372,7 +373,7 @@ $ skyped -n -d == I would like to have support for ... If something does not work and it's not in the TODO section, then please -contact me! Please also try the link:HACKING[git version] before reporting a bug, your +contact me! Please also try the bzr version before reporting a bug, your problem may be already fixed there. In fact, of course, I wrote this documentation after figured out how to do this @@ -392,9 +393,6 @@ You can reach some screenshots link:shot[here]. == Additional resources -You can reach the Changelog link:Changelog[here], and a gitweb interface -http://vmiklos.hu/gitweb/?p=bitlbee-skype.git[here]. - The Skype API documentation is http://developer.skype.com/resources/public_api_ref.zip[here] if you're interested. diff --git a/protocols/skype/asciidoc.conf b/protocols/skype/asciidoc.conf index 24a649c1..f52b3ad6 100644 --- a/protocols/skype/asciidoc.conf +++ b/protocols/skype/asciidoc.conf @@ -4,14 +4,13 @@ ifdef::backend-docbook[] template::[header-declarations] <refentry> <refentryinfo> - <date>{bs_date}</date> + <date>{bee_date}</date> </refentryinfo> <refmeta> <refentrytitle>{mantitle}</refentrytitle> <manvolnum>{manvolnum}</manvolnum> - <refmiscinfo class="source">bitlbee-skype</refmiscinfo> - <refmiscinfo class="version">{bs_version}</refmiscinfo> - <refmiscinfo class="manual">bitlbee-skype manual</refmiscinfo> + <refmiscinfo class="source">BitlBee</refmiscinfo> + <refmiscinfo class="manual">BitlBee manual</refmiscinfo> </refmeta> <refnamediv> <refname>{manname}</refname> diff --git a/protocols/skype/skype.c b/protocols/skype/skype.c index 60471d01..8ff2b639 100644 --- a/protocols/skype/skype.c +++ b/protocols/skype/skype.c @@ -1,7 +1,7 @@ /* * skype.c - Skype plugin for BitlBee * - * Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 by Miklos Vajna <vmiklos@frugalware.org> + * Copyright (c) 2007-2013 by Miklos Vajna <vmiklos@frugalware.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -213,8 +213,7 @@ void skype_buddy_ask(struct im_connection *ic, char *handle, char *message) bla->ic = ic; bla->handle = g_strdup(handle); - buf = g_strdup_printf("The user %s wants to add you to " - "his/her buddy list, saying: '%s'.", handle, message); + buf = g_strdup_printf("The user %s wants to add you to his/her buddy list, saying: '%s'.", handle, message); imcb_ask(ic, buf, bla, skype_buddy_ask_yes, skype_buddy_ask_no); g_free(buf); } @@ -408,8 +407,7 @@ static void skype_parse_user(struct im_connection *ic, char *line) sd->info_about = g_strdup(st->str); g_string_free(st, TRUE); } - } - else if (!strncmp(ptr, "BIRTHDAY ", 9)) { + } else if (!strncmp(ptr, "BIRTHDAY ", 9)) { sd->info_birthday = g_strdup(ptr + 9); GString *st = g_string_new("Contact Information\n"); @@ -565,10 +563,30 @@ static void skype_parse_user(struct im_connection *ic, char *line) } } -static void skype_parse_chatmessage(struct im_connection *ic, char *line) +static void skype_parse_chatmessage_said_emoted(struct im_connection *ic, struct groupchat *gc, char *body) { struct skype_data *sd = ic->proto_data; char buf[IRC_LINE_SIZE]; + if (!strcmp(sd->type, "SAID")) { + if (!sd->is_edit) + g_snprintf(buf, IRC_LINE_SIZE, "%s", body); + else { + g_snprintf(buf, IRC_LINE_SIZE, "%s %s", set_getstr(&ic->acc->set, "edit_prefix"), body); + sd->is_edit = 0; + } + } else + g_snprintf(buf, IRC_LINE_SIZE, "/me %s", body); + if (!gc) + /* Private message */ + imcb_buddy_msg(ic, sd->handle, buf, 0, 0); + else + /* Groupchat message */ + imcb_chat_msg(gc, sd->handle, buf, 0, 0); +} + +static void skype_parse_chatmessage(struct im_connection *ic, char *line) +{ + struct skype_data *sd = ic->proto_data; char *id = strchr(line, ' '); if (!++id) @@ -626,27 +644,7 @@ static void skype_parse_chatmessage(struct im_connection *ic, char *line) char *body = g_list_nth_data(sd->body, i); if (!strcmp(sd->type, "SAID") || !strcmp(sd->type, "EMOTED")) { - if (!strcmp(sd->type, "SAID")) { - if (!sd->is_edit) - g_snprintf(buf, IRC_LINE_SIZE, "%s", - body); - else { - g_snprintf(buf, IRC_LINE_SIZE, "%s %s", - set_getstr(&ic->acc->set, "edit_prefix"), - body); - sd->is_edit = 0; - } - } else - g_snprintf(buf, IRC_LINE_SIZE, "/me %s", - body); - if (!gc) - /* Private message */ - imcb_buddy_msg(ic, - sd->handle, buf, 0, 0); - else - /* Groupchat message */ - imcb_chat_msg(gc, - sd->handle, buf, 0, 0); + skype_parse_chatmessage_said_emoted(ic, gc, body); } else if (!strcmp(sd->type, "SETTOPIC") && gc) imcb_chat_topic(gc, sd->handle, body, 0); @@ -715,8 +713,7 @@ static void skype_parse_call(struct im_connection *ic, char *line) switch (sd->call_status) { case SKYPE_CALL_RINGING: if (sd->call_out) - imcb_log(ic, "You are currently ringing " - "the user %s.", info); + imcb_log(ic, "You are currently ringing the user %s.", info); else { g_snprintf(buf, IRC_LINE_SIZE, "The user %s is currently ringing you.", @@ -1230,7 +1227,7 @@ static void skype_logout(struct im_connection *ic) skype_printf(ic, "SET USERSTATUS OFFLINE\n"); - while( ic->groupchats ) + while (ic->groupchats) imcb_chat_free(ic->groupchats->data); for (i = 0; i < g_list_length(sd->groups); i++) { @@ -1321,6 +1318,15 @@ static char *skype_set_display_name(set_t *set, char *value) return value; } +static char *skype_set_mood_text(set_t *set, char *value) +{ + account_t *acc = set->data; + struct im_connection *ic = acc->ic; + + skype_printf(ic, "SET PROFILE MOOD_TEXT %s", value); + return value; +} + static char *skype_set_balance(set_t *set, char *value) { account_t *acc = set->data; @@ -1513,6 +1519,9 @@ static void skype_init(account_t *acc) acc); s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; + s = set_add(&acc->set, "mood_text", NULL, skype_set_mood_text, acc); + s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; + s = set_add(&acc->set, "call", NULL, skype_set_call, acc); s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; diff --git a/protocols/skype/skyped.txt b/protocols/skype/skyped.txt index 53f2626d..fe0b4d50 100644 --- a/protocols/skype/skyped.txt +++ b/protocols/skype/skyped.txt @@ -11,7 +11,7 @@ skyped [<options>] == DESCRIPTION Skype supports remote control of the GUI client only via X11 or DBus -messages. This is hard in care you want remote control. This daemon +messages. This is hard in case you want remote control. This daemon listens on a TCP port and runs on the same machine where the GUI client runs. It passes all the input it gets to Skype directly, except for a few commands which is related to authentication. The whole communication |