From 7764fb1ce63f1339f005e698ddfeba96186e9925 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 1 Jan 2013 16:44:31 +0100 Subject: skype: support setting mood text Requested by martinc on IRC. --- protocols/skype/README | 5 +++-- protocols/skype/skype.c | 14 +++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'protocols/skype') diff --git a/protocols/skype/README b/protocols/skype/README index 95ac0475..a881b8aa 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: diff --git a/protocols/skype/skype.c b/protocols/skype/skype.c index 60471d01..1caa8b15 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 + * Copyright (c) 2007-2013 by Miklos Vajna * * 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 @@ -1321,6 +1321,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 +1522,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; -- cgit v1.2.3 From e1d6b38fbfa1ba01da45c79a2f1b0951eb5b14bd Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 1 Jan 2013 17:04:34 +0100 Subject: skype: make checkpatch happy again (cosmetics) --- protocols/skype/Makefile | 2 +- protocols/skype/skype.c | 55 +++++++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 30 deletions(-) (limited to 'protocols/skype') diff --git a/protocols/skype/Makefile b/protocols/skype/Makefile index 455a21f2..3afefbc0 100644 --- a/protocols/skype/Makefile +++ b/protocols/skype/Makefile @@ -61,7 +61,7 @@ autoclean: distclean # 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 diff --git a/protocols/skype/skype.c b/protocols/skype/skype.c index 1caa8b15..8ff2b639 100644 --- a/protocols/skype/skype.c +++ b/protocols/skype/skype.c @@ -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++) { -- cgit v1.2.3 From 757e1e0fdd0d80818a480d507e41b5a8e32ceb3e Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 1 Jan 2013 17:19:09 +0100 Subject: skype: remove unused build system targets, references to git --- protocols/skype/HACKING | 8 ----- protocols/skype/Makefile | 73 ++----------------------------------------- protocols/skype/README | 5 +-- protocols/skype/asciidoc.conf | 7 ++--- protocols/skype/skyped.txt | 2 +- 5 files changed, 8 insertions(+), 87 deletions(-) (limited to 'protocols/skype') 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 3afefbc0..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,48 +13,10 @@ 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: @@ -66,20 +25,6 @@ check: 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 a881b8aa..06e608ff 100644 --- a/protocols/skype/README +++ b/protocols/skype/README @@ -373,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 @@ -393,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] - {bs_date} + {bee_date} {mantitle} {manvolnum} - bitlbee-skype - {bs_version} - bitlbee-skype manual + BitlBee + BitlBee manual {manname} 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 [] == 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 -- cgit v1.2.3