Changeset a1d30c5
- Timestamp:
- 2015-05-28T04:12:23Z (10 years ago)
- Children:
- d2d2b80
- Parents:
- ec8b369 (diff), 3d31618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
rec8b369 ra1d30c5 8 8 before_install: 9 9 - sudo apt-get update -qq 10 - sudo apt-get install --no-install-recommends -qq asciidoc xsltproc xmlto lynx checklibevent-dev libpurple-dev check10 - sudo apt-get install --no-install-recommends -qq libevent-dev libpurple-dev check 11 11 - wget http://dump.dequis.org/indexed/bitlbee-travis-libs/libotr5{,-dev}_4.1.0-2~bpo70+1_amd64.deb 12 12 - sudo dpkg -i *.deb -
configure
rec8b369 ra1d30c5 681 681 682 682 if [ "$doc" = "1" ]; then 683 if [ ! -e doc/user-guide/help.txt ] && \ 684 ! type xmlto > /dev/null 2> /dev/null || \ 685 ! type xsltproc > /dev/null 2> /dev/null 686 then 683 # check this here just in case someone tries to install it in python2.4... 684 if ! python -m xml.etree.ElementTree > /dev/null 2>&1; then 687 685 echo 688 echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' 689 echo 'Install xmlto and xsltproc if you want online help to work.' 690 else 691 echo "DOC=1" >> Makefile.settings 692 fi 693 694 if [ "$skype" = "1" -o "$skype" = "plugin" ]; then 695 # skype also needs asciidoc 696 if ! type a2x > /dev/null 2> /dev/null; then 697 echo 698 echo 'WARNING: The skyped man page requires asciidoc. It will not be generated.' 699 else 700 echo "ASCIIDOC=1" >> Makefile.settings 701 fi 702 fi 686 echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' 687 exit 1 688 fi 689 echo "DOC=1" >> Makefile.settings 703 690 fi 704 691 -
debian/bitlbee-common.docs
rec8b369 ra1d30c5 1 doc/user-guide/user-guide.txt2 doc/user-guide/user-guide.html3 1 doc/AUTHORS 4 2 doc/CREDITS -
debian/control
rec8b369 ra1d30c5 5 5 Uploaders: Jelmer Vernooij <jelmer@debian.org> 6 6 Standards-Version: 3.9.5 7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls28-dev | libgnutls-dev | gnutls-dev, po-debconf, libpurple-dev, libotr5-dev, debhelper (>= 6.0.7~) , asciidoc7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls28-dev | libgnutls-dev | gnutls-dev, po-debconf, libpurple-dev, libotr5-dev, debhelper (>= 6.0.7~) 8 8 Homepage: http://www.bitlbee.org/ 9 9 Vcs-Bzr: http://code.bitlbee.org/bitlbee/ -
doc/user-guide/Makefile
rec8b369 ra1d30c5 4 4 endif 5 5 6 EXTRAPARANEWLINE = 1 7 # EXTRAPARANEWLINE = 0 6 all: help.txt 8 7 9 all: user-guide.txt user-guide.html help.txt# user-guide.pdf user-guide.ps user-guide.rtf8 user-guide: user-guide.txt user-guide.html # user-guide.pdf user-guide.ps user-guide.rtf 10 9 11 10 %.tex: %.db.xml … … 33 32 34 33 help.txt: help.xml help.xsl commands.xml misc.xml quickstart.xml 35 xsltproc --stringparam extraparanewline "$(EXTRAPARANEWLINE)" --xinclude help.xsl $< | perl -0077 -pe 's/\n\n%/\n%/s; s/_b_/\002/g;' >$@34 python genhelp.py $< $@ 36 35 37 36 clean: … … 48 47 -rmdir $(DESTDIR)$(DATADIR) 49 48 50 .PHONY: clean install uninstall 49 .PHONY: clean install uninstall user-guide -
nick.c
rec8b369 ra1d30c5 368 368 369 369 if (tab['A'] == 0) { 370 /* initialize table so nonchars are mapped to themselves */ 371 for (i = 0; i < sizeof(tab); i++) { 372 tab[i] = i; 373 } 374 /* replace uppercase chars with lowercase chars */ 370 375 for (i = 0; nick_lc_chars[i]; i++) { 371 376 tab[(int) nick_uc_chars[i]] = nick_lc_chars[i]; 372 tab[(int) nick_lc_chars[i]] = nick_lc_chars[i];373 377 } 374 378 } -
otr.c
rec8b369 ra1d30c5 193 193 void show_general_otr_info(irc_t *irc); 194 194 195 /* show info about a given OTR context */ 196 void show_otr_context_info(irc_t *irc, ConnContext *ctx); 195 /* show info about a given OTR context and subcontexts/instances. bestctx 196 may be either NULL or preferred destination context (this is hilighted 197 in the output as being the target for a message) */ 198 void show_otr_context_info(irc_t *irc, ConnContext *ctx, ConnContext *bestctx); 197 199 198 200 /* show the list of fingerprints associated with a given context */ … … 1102 1104 char *arg = g_strdup(args[1]); 1103 1105 char *myhandle, *handle = NULL, *protocol; 1104 ConnContext * ctx;1106 ConnContext *bestctx = NULL, *ctx; 1105 1107 1106 1108 /* interpret arg as 'user/protocol/account' if possible */ … … 1135 1137 return; 1136 1138 } 1139 /* This does no harm if it returns NULL */ 1140 bestctx = otrl_context_find(irc->otr->us, u->bu->handle, u->bu->ic->acc->user, 1141 u->bu->ic->acc->prpl->name, OTRL_INSTAG_BEST, 0, NULL, NULL, NULL); 1137 1142 } 1138 1143 1139 1144 /* show how we resolved the (nick) argument, if we did */ 1140 1145 if (handle != arg) { 1141 irc_rootmsg(irc, "%s is %s/%s; we are %s/%s to them", args[1], 1142 ctx->username, ctx->protocol, ctx->accountname, ctx->protocol); 1143 } 1144 show_otr_context_info(irc, ctx); 1146 irc_rootmsg(irc, "%s:", args[1]); 1147 irc_rootmsg(irc, " they are: %s/%s", ctx->username, ctx->protocol); 1148 irc_rootmsg(irc, " we are: %s/%s", ctx->accountname, ctx->protocol); 1149 } 1150 show_otr_context_info(irc, ctx, bestctx); 1145 1151 g_free(arg); 1146 1152 } … … 1549 1555 int count = 0; 1550 1556 1551 for (fp = &ctx->fingerprint_root; fp; fp = fp->next) { 1557 /* Is this a subcontext? If so, only list the active fingerprint */ 1558 if (ctx->m_context != ctx) { 1559 fp = ctx->active_fingerprint; 1560 } else { 1561 fp = &ctx->fingerprint_root; 1562 } 1563 1564 while (fp) { 1552 1565 if (!fp->fingerprint) { 1566 fp = fp->next; 1553 1567 continue; 1554 1568 } … … 1561 1575 } 1562 1576 if (fp == ctx->active_fingerprint) { 1563 irc_rootmsg(irc, " \x02%s (%s)\x02", human, trust);1577 irc_rootmsg(irc, " \x02%s (%s)\x02", human, trust); 1564 1578 } else { 1565 irc_rootmsg(irc, " %s (%s)", human, trust); 1566 } 1579 irc_rootmsg(irc, " %s (%s)", human, trust); 1580 } 1581 1582 /* Break if this is a subcontext - we only print active fp */ 1583 if (ctx->m_context != ctx) { 1584 break; 1585 } 1586 fp = fp->next; 1567 1587 } 1568 1588 if (count == 0) { 1569 irc_rootmsg(irc, " (none)");1589 irc_rootmsg(irc, " (none)"); 1570 1590 } 1571 1591 } … … 1755 1775 /* list all contexts */ 1756 1776 /* XXX remove this, or split off as its own command */ 1757 /* XXX show instags? */1758 1777 irc_rootmsg(irc, "%s", ""); 1759 1778 irc_rootmsg(irc, "\x1f" "connection contexts:\x1f (bold=currently encrypted)"); 1760 for (ctx = irc->otr->us->context_root; ctx; ctx = ctx->next) { \ 1779 1780 ctx = irc->otr->us->context_root; 1781 while (ctx) { 1782 ConnContext *subctx; 1761 1783 irc_user_t *u; 1762 1784 char *userstring; 1785 char encrypted = 0; 1763 1786 1764 1787 u = peeruser(irc, ctx->username, ctx->protocol); … … 1771 1794 } 1772 1795 1773 if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) { 1796 subctx = ctx; 1797 while (subctx && subctx->m_context == ctx) { 1798 if (subctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) { 1799 encrypted = 1; 1800 } 1801 subctx = subctx->next; 1802 } 1803 1804 if(encrypted) { 1774 1805 irc_rootmsg(irc, " \x02%s\x02", userstring); 1775 1806 } else { … … 1777 1808 } 1778 1809 1810 /* Skip subcontexts/instances from output */ 1811 ctx = subctx; 1812 1779 1813 g_free(userstring); 1780 1814 } 1815 1781 1816 if (ctx == irc->otr->us->context_root) { 1782 1817 irc_rootmsg(irc, " (none)"); … … 1784 1819 } 1785 1820 1786 void show_otr_context_info(irc_t *irc, ConnContext *ctx) 1787 { 1788 // XXX show all instags/subcontexts 1789 1790 switch (ctx->otr_offer) { 1791 case OFFER_NOT: 1792 irc_rootmsg(irc, " otr offer status: none sent"); 1793 break; 1794 case OFFER_SENT: 1795 irc_rootmsg(irc, " otr offer status: awaiting reply"); 1796 break; 1797 case OFFER_ACCEPTED: 1798 irc_rootmsg(irc, " otr offer status: accepted our offer"); 1799 break; 1800 case OFFER_REJECTED: 1801 irc_rootmsg(irc, " otr offer status: ignored our offer"); 1802 break; 1803 default: 1804 irc_rootmsg(irc, " otr offer status: %d", ctx->otr_offer); 1805 } 1806 1807 switch (ctx->msgstate) { 1808 case OTRL_MSGSTATE_PLAINTEXT: 1809 irc_rootmsg(irc, " connection state: cleartext"); 1810 break; 1811 case OTRL_MSGSTATE_ENCRYPTED: 1812 irc_rootmsg(irc, " connection state: encrypted (v%d)", ctx->protocol_version); 1813 break; 1814 case OTRL_MSGSTATE_FINISHED: 1815 irc_rootmsg(irc, " connection state: shut down"); 1816 break; 1817 default: 1818 irc_rootmsg(irc, " connection state: %d", ctx->msgstate); 1819 } 1820 1821 irc_rootmsg(irc, " fingerprints: (bold=active)"); 1822 show_fingerprints(irc, ctx); 1821 void show_otr_context_info(irc_t *irc, ConnContext *ctx, ConnContext *bestctx) 1822 { 1823 ConnContext *subctx; 1824 int instcount = 0; 1825 1826 subctx = ctx; 1827 while (subctx && subctx->m_context == ctx) { 1828 if (subctx->m_context == subctx) { 1829 if (subctx == bestctx) { 1830 irc_rootmsg(irc, " \x02master context (target):\x02"); 1831 } else { 1832 irc_rootmsg(irc, " master context:"); 1833 } 1834 irc_rootmsg(irc, " known fingerprints (bold = active for v1 or v2):"); 1835 } else { 1836 if (subctx == bestctx) { 1837 irc_rootmsg(irc, " \x02instance %d (target):\x02", instcount); 1838 } else { 1839 irc_rootmsg(irc, " instance %d:", instcount); 1840 } 1841 irc_rootmsg(irc, " active fingerprint:"); 1842 instcount++; 1843 } 1844 1845 show_fingerprints(irc, subctx); 1846 1847 switch (subctx->msgstate) { 1848 case OTRL_MSGSTATE_PLAINTEXT: 1849 irc_rootmsg(irc, " connection state: cleartext"); 1850 break; 1851 case OTRL_MSGSTATE_ENCRYPTED: 1852 irc_rootmsg(irc, " connection state: encrypted (v%d)", subctx->protocol_version); 1853 break; 1854 case OTRL_MSGSTATE_FINISHED: 1855 irc_rootmsg(irc, " connection state: shut down"); 1856 break; 1857 default: 1858 irc_rootmsg(irc, " connection state: %d", subctx->msgstate); 1859 } 1860 1861 subctx = subctx->next; 1862 } 1823 1863 } 1824 1864 -
protocols/jabber/presence.c
rec8b369 ra1d30c5 181 181 } 182 182 183 static char *choose_priority(struct im_connection *ic) 184 { 185 struct jabber_data *jd = ic->proto_data; 186 char *prio = set_getstr(&ic->acc->set, "priority"); 187 188 if (jd->away_state->code != NULL) { 189 int new_prio = (atoi(prio) - 5); 190 if (new_prio < 0) { 191 new_prio = 0; 192 } 193 return g_strdup_printf("%d", new_prio); 194 } 195 196 return g_strdup(prio); 197 } 198 183 199 /* Whenever presence information is updated, call this function to inform the 184 200 server. */ … … 189 205 GSList *l; 190 206 int st; 207 char *prio = choose_priority(ic); 191 208 192 209 node = jabber_make_packet("presence", NULL, NULL, NULL); 193 xt_add_child(node, xt_new_node("priority", set_getstr(&ic->acc->set, "priority"), NULL));210 xt_add_child(node, xt_new_node("priority", prio, NULL)); 194 211 if (jd->away_state) { 195 212 xt_add_child(node, xt_new_node("show", jd->away_state->code, NULL)); … … 222 239 223 240 xt_free_node(node); 241 g_free(prio); 224 242 return st; 225 243 } -
protocols/msn/msn.c
rec8b369 ra1d30c5 144 144 { 145 145 struct bee_user *bu = bee_user_by_handle(ic->bee, ic, who); 146 147 #ifdef DEBUG 148 if (strcmp(who, "raw") == 0) { 149 msn_ns_write(ic, -1, "%s\r\n", message); 150 return 0; 151 } 152 #endif 153 154 msn_ns_sendmessage(ic, bu, message); 155 return(0); 146 msn_ns_send_message(ic, bu, message); 147 return 0; 156 148 } 157 149 … … 277 269 return 0; 278 270 } else if (typing & OPT_TYPING) { 279 return (msn_buddy_msg(ic, who, TYPING_NOTIFICATION_MESSAGE, 0));271 return msn_ns_send_typing(ic, bu); 280 272 } else { 281 273 return 1; … … 338 330 339 331 g_tree_remove(md->domaintree, bu->handle); 340 }341 342 GList *msn_buddy_action_list(bee_user_t *bu)343 {344 static GList *ret = NULL;345 346 if (ret == NULL) {347 static const struct buddy_action ba[2] = {348 { "NUDGE", "Draw attention" },349 };350 351 ret = g_list_prepend(ret, (void *) ba + 0);352 }353 354 return ret;355 }356 357 void *msn_buddy_action(struct bee_user *bu, const char *action, char * const args[], void *data)358 {359 if (g_strcasecmp(action, "NUDGE") == 0) {360 msn_buddy_msg(bu->ic, bu->handle, NUDGE_MESSAGE, 0);361 }362 363 return NULL;364 332 } 365 333 … … 392 360 ret->buddy_data_add = msn_buddy_data_add; 393 361 ret->buddy_data_free = msn_buddy_data_free; 394 ret->buddy_action_list = msn_buddy_action_list;395 ret->buddy_action = msn_buddy_action;396 362 397 363 register_protocol(ret); -
protocols/msn/msn.h
rec8b369 ra1d30c5 26 26 #ifndef _MSN_H 27 27 #define _MSN_H 28 29 /* Some hackish magicstrings to make special-purpose messages/switchboards.30 */31 #define TYPING_NOTIFICATION_MESSAGE "\r\r\rBEWARE, ME R TYPINK MESSAGE!!!!\r\r\r"32 #define NUDGE_MESSAGE "\r\r\rSHAKE THAT THING\r\r\r"33 #define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r"34 35 #ifdef DEBUG_MSN36 #define debug(text ...) imcb_log(ic, text);37 #else38 #define debug(text ...)39 #endif40 28 41 29 /* This should be MSN Messenger 7.0.0813 … … 77 65 #define MSN_MESSAGE_HEADERS MSN_BASE_HEADERS \ 78 66 "Messaging: 2.0\r\n" \ 79 "Message-Type: Text\r\n" \67 "Message-Type: %s\r\n" \ 80 68 "Content-Length: %zd\r\n" \ 81 69 "Content-Type: text/plain; charset=UTF-8\r\n" \ … … 103 91 "</user>" 104 92 105 #define MSN_TYPING_HEADERS "MIME-Version: 1.0\r\n" \106 "Content-Type: text/x-msmsgscontrol\r\n" \107 "TypingUser: %s\r\n" \108 "\r\n\r\n"109 110 #define MSN_NUDGE_HEADERS "MIME-Version: 1.0\r\n" \111 "Content-Type: text/x-msnmsgr-datacast\r\n" \112 "\r\n" \113 "ID: 1\r\n" \114 "\r\n"115 116 93 #define PROFILE_URL "http://members.msn.com/" 117 94 … … 242 219 void msn_auth_got_contact_list(struct im_connection *ic); 243 220 int msn_ns_finish_login(struct im_connection *ic); 244 int msn_ns_sendmessage(struct im_connection *ic, struct bee_user *bu, const char *text); 221 int msn_ns_send_typing(struct im_connection *ic, struct bee_user *bu); 222 int msn_ns_send_message(struct im_connection *ic, struct bee_user *bu, const char *text); 245 223 int msn_ns_command(struct msn_data *md, char **cmd, int num_parts); 246 224 int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int num_parts); -
protocols/msn/ns.c
rec8b369 ra1d30c5 417 417 } else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) { 418 418 /* Notification that a message has been read... Ignore it */ 419 } else {420 debug("Can't handle %s packet from notification server", ct);421 419 } 422 420 … … 623 621 char l[4]; 624 622 625 if ((bd->flags & 7) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) {623 if ((bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) { 626 624 return FALSE; 627 625 } … … 641 639 } 642 640 643 g_snprintf(l, sizeof(l), "%d", bd->flags & 7);641 g_snprintf(l, sizeof(l), "%d", bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)); 644 642 c = xt_new_node("c", NULL, NULL); 645 643 xt_add_attr(c, "n", handle); … … 694 692 struct msn_buddy_data *bd = bu->data; 695 693 696 if (bu->ic != ic || (bd->flags & 7) == 0) {694 if (bu->ic != ic || (bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0) { 697 695 continue; 698 696 } … … 724 722 } 725 723 726 // TODO: typing notifications, nudges lol, etc 727 int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text) 724 static int msn_ns_send_sdg(struct im_connection *ic, bee_user_t *bu, const char *message_type, const char *text) 728 725 { 729 726 struct msn_data *md = ic->proto_data; … … 731 728 char *buf; 732 729 733 if (strncmp(text, "\r\r\r", 3) == 0) { 734 /* Err. Shouldn't happen but I guess it can. Don't send others 735 any of the "SHAKE THAT THING" messages. :-D */ 736 return 1; 737 } 738 739 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, strlen(text), text); 730 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 740 731 retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 741 732 g_free(buf); 742 733 return retval; 743 734 } 735 736 int msn_ns_send_typing(struct im_connection *ic, bee_user_t *bu) 737 { 738 return msn_ns_send_sdg(ic, bu, "Control/Typing", ""); 739 } 740 741 int msn_ns_send_message(struct im_connection *ic, bee_user_t *bu, const char *text) 742 { 743 return msn_ns_send_sdg(ic, bu, "Text", text); 744 } 745 -
protocols/skype/Makefile
rec8b369 ra1d30c5 7 7 INSTALL = install 8 8 9 10 ifdef ASCIIDOC 11 MANPAGES = skyped.1 12 else 13 MANPAGES = 14 endif 15 16 all: $(MANPAGES) 17 9 all: 18 10 clean: 19 rm -f $(MANPAGES)20 11 21 12 # take this from the kernel … … 29 20 30 21 install-doc: doc 31 ifdef ASCIIDOC32 22 $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1 33 23 $(INSTALL) -m644 $(MANPAGES) $(DESTDIR)$(MANDIR)/man1 34 endif35 24 36 25 uninstall-doc: … … 38 27 39 28 %.1: $(_SRCDIR_)%.txt $(_SRCDIR_)asciidoc.conf 40 a2x --asciidoc-opts="-f $(_SRCDIR_)asciidoc.conf" -a bee_date=$(DATE) -f manpage -D .$<29 a2x --asciidoc-opts="-f $(_SRCDIR_)asciidoc.conf" -a bee_date=$(DATE) -f manpage $<
Note: See TracChangeset
for help on using the changeset viewer.