Changes in / [0c42c65:4804b2f]


Ignore:
Files:
21 added
8 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r0c42c65 r4804b2f  
    2727subdirobjs = $(foreach dir,$(subdirs),$(dir)/$(dir).o)
    2828
    29 all: $(OUTFILE) $(OTR_PI) systemd
     29all: $(OUTFILE) $(OTR_PI) $(SKYPE_PI) systemd
    3030        $(MAKE) -C doc
     31ifdef SKYPE_PI
     32        $(MAKE) -C protocols/skype doc
     33endif
    3134
    3235uninstall: uninstall-bin uninstall-doc
     
    7174install-doc:
    7275        $(MAKE) -C doc install
     76ifdef SKYPE_PI
     77        $(MAKE) -C protocols/skype install-doc
     78endif
    7379
    7480uninstall-doc:
    7581        $(MAKE) -C doc uninstall
     82ifdef SKYPE_PI
     83        $(MAKE) -C protocols/skype uninstall-doc
     84endif
    7685
    7786install-bin:
     
    109118        install -m 0755 otr.so $(DESTDIR)$(PLUGINDIR)
    110119endif
     120ifdef SKYPE_PI
     121        mkdir -p $(DESTDIR)$(PLUGINDIR)
     122        install -m 0755 skype.so $(DESTDIR)$(PLUGINDIR)
     123        mkdir -p $(DESTDIR)$(ETCDIR)/../skyped
     124        install -m 0644 $(SRCDIR)protocols/skype/skyped.cnf $(DESTDIR)$(ETCDIR)/../skyped/skyped.cnf
     125        install -m 0644 $(SRCDIR)protocols/skype/skyped.conf $(DESTDIR)$(ETCDIR)/../skyped/skyped.conf
     126        install -m 0755 $(SRCDIR)protocols/skype/skyped.py $(DESTDIR)$(BINDIR)/skyped
     127endif
    111128
    112129systemd:
     
    141158        @$(CC) $(CFLAGS) $(OTRFLAGS) -fPIC -shared $(LDFLAGS) $< -o $@
    142159
     160$(SKYPE_PI): $(SRCDIR)protocols/skype/skype.c
     161        @echo '*' Building plugin skype
     162        @$(CC) $(CFLAGS) -fPIC -shared $< -o $@
     163
    143164$(objects): %.o: $(SRCDIR)%.c
    144165        @echo '*' Compiling $<
     
    164185
    165186-include .depend/*.d
     187# DO NOT DELETE
  • configure

    r0c42c65 r4804b2f  
    3636plugins=1
    3737otr=0
     38skype=0
    3839
    3940events=glib
     
    8384--otr=0/1/auto/plugin
    8485                Disable/enable OTR encryption support   $otr
     86--skype=0/1/plugin
     87                Disable/enable Skype support            $skype
    8588
    8689--events=...    Event handler (glib, libevent)          $events
     
    109112ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
    110113pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
     114
     115protocols_mods=""
    111116
    112117cat<<EOF>Makefile.settings
     
    538543fi
    539544
     545if [ "$skype" = "1" -o "$skype" = "plugin" ]; then
     546        echo 'SKYPE_PI=skype.so' >> Makefile.settings
     547        protocols_mods="$protocol_mods skype(plugin)"
     548fi
     549
    540550if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then
    541551        echo
     
    751761
    752762if [ -n "$protocols" ]; then
    753         echo '  Building with these protocols:' $protocols
     763        echo '  Building with these protocols:' $protocols$protocols_mods
    754764        case "$protocols" in
    755765        *purple*)
  • doc/user-guide/commands.xml

    r0c42c65 r4804b2f  
    852852
    853853                        <variablelist>
    854                                 <varlistentry><term>undo [&lt;id&gt;]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry>
    855                                 <varlistentry><term>rt &lt;screenname|id&gt;</term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry>
    856                                 <varlistentry><term>reply &lt;screenname|id&gt;</term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry>
     854                                <varlistentry><term>undo #[&lt;id&gt;]</term><listitem><para>Delete your last Tweet (or one with the given ID)</para></listitem></varlistentry>
     855                                <varlistentry><term>rt &lt;screenname|#id&gt;</term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry>
     856                                <varlistentry><term>reply &lt;screenname|#id&gt;</term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry>
    857857                                <varlistentry><term>follow &lt;screenname&gt;</term><listitem><para>Start following a person</para></listitem></varlistentry>
    858858                                <varlistentry><term>unfollow &lt;screenname&gt;</term><listitem><para>Stop following a person</para></listitem></varlistentry>
  • doc/user-guide/quickstart.xml

    r0c42c65 r4804b2f  
    122122
    123123<para>
    124 Account tagging allows you to use the given account name rather than a number when referencing your account. If you wish to turn off your gtalk account, you may <emphasis>account off gtalk</emphasis> rather than <emphasis>account off 3</emphasis> where "3" is the account number.
     124Account tagging allows you to use the given account name rather than a number when referencing your account. If you wish to turn off your gtalk account, you may <emphasis>account gtalk off</emphasis> rather than <emphasis>account 3 off</emphasis> where "3" is the account number.
    125125</para>
    126126
  • lib/misc.c

    r0c42c65 r4804b2f  
    400400        cd = g_iconv_open( to_cs, from_cs );
    401401        if( cd == (GIConv) -1 )
    402                 return( -1 );
     402                return -1;
    403403       
    404404        inbytesleft = size ? size : strlen( src );
     
    408408        g_iconv_close( cd );
    409409       
    410         if( res == (size_t) -1 )
    411                 return( -1 );
     410        if( res != 0 )
     411                return -1;
    412412        else
    413                 return( outbuf - dst );
     413                return outbuf - dst;
    414414}
    415415
  • lib/proxy.c

    r0c42c65 r4804b2f  
    8585                                closesocket(source);
    8686                                dup2(new_fd, source);
     87                                closesocket(new_fd);
    8788                                phb->inpa = b_input_add(source, B_EV_IO_WRITE, gaim_io_connected, phb);
    8889                                return FALSE;
  • otr.c

    r0c42c65 r4804b2f  
    88  OTR support (cf. http://www.cypherpunks.ca/otr/)
    99 
    10   (c) 2008-2010 Sven Moritz Hallberg <pesco@khjk.org>
     10  (c) 2008-2011 Sven Moritz Hallberg <pesco@khjk.org>
    1111  (c) 2008 funded by stonedcoder.org
    1212   
     
    162162void otr_smp_or_smpq(irc_t *irc, const char *nick, const char *question,
    163163                const char *secret);
     164
     165/* update flags within the irc_user structure to reflect OTR status of context */
     166void otr_update_uflags(ConnContext *context, irc_user_t *u);
    164167
    165168/* update op/voice flag of given user according to encryption state and settings
     
    237240        l = g_slist_prepend( l, "always" );
    238241        s->eval_data = l;
     242
     243        s = set_add( &irc->b->set, "otr_does_html", "true", set_eval_bool, irc );
    239244       
    240245        return TRUE;
     
    385390                ConnContext *context = otrl_context_find(irc->otr->us, iu->bu->handle,
    386391                        ic->acc->user, ic->acc->prpl->name, 0, NULL, NULL, NULL);
    387                 if(context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
    388                    set_getbool(&ic->bee->set, "otr_color_encrypted")) {
    389                         /* color according to f'print trust */
    390                         int color;
    391                         const char *trust = context->active_fingerprint->trust;
    392                         if(trust && trust[0] != '\0')
    393                                 color=3;   /* green */
    394                         else
    395                                 color=5;   /* red */
    396 
    397                         if(newmsg[0] == ',') {
    398                                 /* could be a problem with the color code */
    399                                 /* insert a space between color spec and message */
    400                                 colormsg = g_strdup_printf("\x03%.2d %s\x0F", color, newmsg);
    401                         } else {
    402                                 colormsg = g_strdup_printf("\x03%.2d%s\x0F", color, newmsg);
     392
     393                if(context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED) {
     394                        /* HTML decoding */
     395                        /* perform any necessary stripping that the top level would miss */
     396                        if(set_getbool(&ic->bee->set, "otr_does_html") &&
     397                           !(ic->flags & OPT_DOES_HTML) &&
     398                           set_getbool(&ic->bee->set, "strip_html")) {
     399                                strip_html(newmsg);
     400                        }
     401
     402                        /* coloring */
     403                        if(set_getbool(&ic->bee->set, "otr_color_encrypted")) {
     404                                /* color according to f'print trust */
     405                                int color;
     406                                const char *trust = context->active_fingerprint->trust;
     407                                if(trust && trust[0] != '\0')
     408                                        color=3;   /* green */
     409                                else
     410                                        color=5;   /* red */
     411
     412                                if(newmsg[0] == ',') {
     413                                        /* could be a problem with the color code */
     414                                        /* insert a space between color spec and message */
     415                                        colormsg = g_strdup_printf("\x03%.2d %s\x0F", color, newmsg);
     416                                } else {
     417                                        colormsg = g_strdup_printf("\x03%.2d%s\x0F", color, newmsg);
     418                                }
    403419                        }
    404420                } else {
    405421                        colormsg = g_strdup(newmsg);
    406422                }
     423
    407424                otrl_message_free(newmsg);
    408425                return colormsg;
     
    421438        if(ic->acc->prpl->options & OPT_NOOTR) {
    422439                return msg;
     440        }
     441
     442        /* HTML encoding */
     443        /* consider OTR plaintext to be HTML if otr_does_html is set */
     444        if(set_getbool(&ic->bee->set, "otr_does_html") &&
     445           (g_strncasecmp(msg, "<html>", 6) != 0)) {
     446                msg = escape_html(msg);
    423447        }
    424448       
     
    608632        irc_user_t *u;
    609633        irc_t *irc = ic->bee->ui_data;
    610         const char *trust;
    611634
    612635        u = peeruser(irc, context->username, context->protocol);
     
    618641        }
    619642       
    620         trust = context->active_fingerprint->trust;
    621         if(trust && trust[0])
    622                 u->flags |= IRC_USER_OTR_ENCRYPTED | IRC_USER_OTR_TRUSTED;
    623         else
    624                 u->flags = ( u->flags & ~IRC_USER_OTR_TRUSTED ) | IRC_USER_OTR_ENCRYPTED;
    625         if(!otr_update_modeflags(irc, u))
    626                 irc_usermsg(irc, "conversation with %s is now off the record", u->nick);
     643        otr_update_uflags(context, u);
     644        if(!otr_update_modeflags(irc, u)) {
     645                char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!";
     646                irc_usermsg(irc, "conversation with %s is now off the record (%s)", u->nick, trust);
     647        }
    627648}
    628649
     
    641662                return;
    642663        }
    643         u->flags &= ~( IRC_USER_OTR_ENCRYPTED | IRC_USER_OTR_TRUSTED );
     664        otr_update_uflags(context, u);
    644665        if(!otr_update_modeflags(irc, u))
    645666                irc_usermsg(irc, "conversation with %s is now in the clear", u->nick);
     
    660681                return;
    661682        }
    662         if(context->active_fingerprint->trust[0])
    663                 u->flags |= IRC_USER_OTR_ENCRYPTED | IRC_USER_OTR_TRUSTED;
    664         else
    665                 u->flags = ( u->flags & ~IRC_USER_OTR_TRUSTED ) | IRC_USER_OTR_ENCRYPTED;
    666         if(!otr_update_modeflags(irc, u))
    667                 irc_usermsg(irc, "otr connection with %s has been refreshed", u->nick);
     683
     684        otr_update_uflags(context, u);
     685        if(!otr_update_modeflags(irc, u)) {
     686                char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!";
     687                irc_usermsg(irc, "otr connection with %s has been refreshed (%s)", u->nick, trust);
     688        }
    668689}
    669690
     
    13121333}
    13131334
     1335void otr_update_uflags(ConnContext *context, irc_user_t *u)
     1336{
     1337        const char *trust;
     1338
     1339        if(context->active_fingerprint) {
     1340                u->flags |= IRC_USER_OTR_ENCRYPTED;
     1341
     1342                trust = context->active_fingerprint->trust;
     1343                if(trust && trust[0])
     1344                        u->flags |= IRC_USER_OTR_TRUSTED;
     1345                else
     1346                        u->flags &= ~IRC_USER_OTR_TRUSTED;
     1347        } else {
     1348                u->flags &= ~IRC_USER_OTR_ENCRYPTED;
     1349        }
     1350}
     1351
    13141352int otr_update_modeflags(irc_t *irc, irc_user_t *u)
    13151353{
    1316         return 1;
     1354        return 0;
    13171355}
    13181356
  • protocols/twitter/twitter.c

    r0c42c65 r4804b2f  
    465465                guint64 id;
    466466
    467                 if (cmd[1])
    468                         id = g_ascii_strtoull(cmd[1], NULL, 10);
    469                 else
    470                         id = td->last_status_id;
    471 
    472                 /* TODO: User feedback. */
    473                 if (id)
     467                if (cmd[1] == NULL)
     468                        twitter_status_destroy(ic, td->last_status_id);
     469                else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1) {
     470                        if (id < TWITTER_LOG_LENGTH && td->log)
     471                                id = td->log[id].id;
     472                       
    474473                        twitter_status_destroy(ic, id);
    475                 else
     474                } else
    476475                        twitter_msg(ic, "Could not undo last action");
    477476
     
    491490                guint64 id;
    492491
    493                 if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) &&
     492                if (g_str_has_prefix(cmd[1], "#") &&
     493                    sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1) {
     494                        if (id < TWITTER_LOG_LENGTH && td->log)
     495                                id = td->log[id].id;
     496                } else if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) &&
    494497                    (tud = bu->data) && tud->last_id)
    495498                        id = tud->last_id;
    496                 else {
    497                         id = g_ascii_strtoull(cmd[1], NULL, 10);
     499                else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1){
    498500                        if (id < TWITTER_LOG_LENGTH && td->log)
    499501                                id = td->log[id].id;
     
    514516                guint64 id = 0;
    515517
    516                 if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) &&
     518                if (g_str_has_prefix(cmd[1], "#") &&
     519                    sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1 &&
     520                    (id < TWITTER_LOG_LENGTH) && td->log) {
     521                        bu = td->log[id].bu;
     522                        if (g_slist_find(ic->bee->users, bu))
     523                                id = td->log[id].id;
     524                        else
     525                                bu = NULL;
     526                } else if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) &&
    517527                    (tud = bu->data) && tud->last_id) {
    518528                        id = tud->last_id;
     
    525535                                bu = NULL;
    526536                }
     537
    527538                if (!id || !bu) {
    528539                        twitter_msg(ic, "User `%s' does not exist or didn't "
Note: See TracChangeset for help on using the changeset viewer.