~micahg/ubuntu/natty/pidgin/2.7.9-2

« back to all changes in this revision

Viewing changes to libpurple/protocols/mxit/markup.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-08-11 14:16:15 UTC
  • mfrom: (1.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20100811141615-lsqya0vlqrnu14lo
Tags: 1:2.7.3-1ubuntu1
* Resync on Debian, workaround build issue (lp:#600952) 
* debian/control:
  - Build-Depends on liblaunchpad-integration-dev
  - Drop libpurple0 dependency from libpurple-bin
  - Drop pidgin-data dependency from libpurple0
  - Recommends pidgin-libnotify
* debian/libpurple0.symbols: 
  - add epochs
* debian/patches/02_lpi.patch:
  - launchpad integration
* debian/patches/04_let_crasher_for_apport.patch:
  - stop catching the SIGSEGV signal and let apport handle it
* debian/patches/05_default_to_irc_ubuntu_com.patch:
  - set the default IRC server to irc.ubuntu.com
* debian/patches/10_docklet_default_off.patch:
  - default behavior to have no notification area icon.
* debian/patches/11_buddy_list_really_show.patch:
  - the buddy list tries harder to appear.  This fixes some issues with it
    not appearing.
* debian/patches/ 13_sounds_and_timers.patch:
  - adjusts the time out for sounds to be 15 seconds, 
    which helps get fewer spurious login notifications on slow connections.
* debian/patches/60_1024x600_gtk*.c.patch: 
  - add scrollbars into preferences and pounce dialogs
* debian/prefs.xml: 
  - Update to set the notify plugin prefs /plugins/gtk/X11/notify/*, 
    set /pidgin/plugins/loaded to load the notify plugin and enable 
    the standard logging options by default
* debian/rules:
  - install a launcher in the message indicator
  - set translation domain and update template
  - use simple-patchsys rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
         * all the text as is to the conversation window. this message dump is very
258
258
         * confusing and makes it totally unusable. to work around this we will count
259
259
         * the amount of tags and if its more than the pidgin threshold, we will just
260
 
         * break the message up into smaller parts and send them seperately to pidgin.
 
260
         * break the message up into smaller parts and send them separately to pidgin.
261
261
         * to the user it will look like multiple messages, but at least he will be able
262
262
         * to use and understand it.
263
263
         */
662
662
 *  @param message                      The message text
663
663
 *  @return                                     The length of the message to skip
664
664
 */
665
 
static int mxit_extract_chatroom_nick( struct RXMsgData* mx, char* message, int len )
 
665
static int mxit_extract_chatroom_nick( struct RXMsgData* mx, char* message, int len, int msgflags )
666
666
{
667
667
        int             i;
668
668
 
673
673
                 * Search for it....
674
674
                 */
675
675
                gboolean        found   = FALSE;
676
 
                gchar*          nickname;
677
676
 
678
677
                for ( i = 1; i < len; i++ ) {
679
678
                        if ( ( message[i] == '\n' ) && ( message[i-1] == '>' ) ) {
685
684
                }
686
685
 
687
686
                if ( found ) {
 
687
                        gchar*          nickname;
 
688
 
688
689
                        /*
689
690
                         * The message definitely had an embedded nickname - generate a marked-up
690
691
                         * message to be displayed.
691
692
                         */
692
693
                        nickname = g_markup_escape_text( &message[1], -1 );
693
694
 
 
695
                        /* Remove any MXit escaping from nickname ("\X" --> "X") */
 
696
                        if ( msgflags & CP_MSG_MARKUP ) {
 
697
                                int     nicklen = strlen( nickname );
 
698
                                int     j, k;
 
699
 
 
700
                                for ( j = 0, k = 0; j < nicklen; j++ ) {
 
701
                                        if ( nickname[j] == '\\' )
 
702
                                                j++;
 
703
 
 
704
                                        nickname[k] = nickname[j];
 
705
                                        k++;
 
706
                                }
 
707
 
 
708
                                nickname[k] = '\0';             /* terminate string */
 
709
                        }
 
710
 
694
711
                        /* add nickname within some BOLD markup to the new converted message */
695
712
                        g_string_append_printf( mx->msg, "<b>%s:</b> ", nickname );
696
713
 
747
764
        if ( is_mxit_chatroom_contact( mx->session, mx->from ) ) {
748
765
                /* chatroom message, so we need to extract and skip the sender's nickname
749
766
                 * which is embedded inside the message */
750
 
                i = mxit_extract_chatroom_nick( mx, message, len );
 
767
                i = mxit_extract_chatroom_nick( mx, message, len, msgflags );
751
768
        }
752
769
 
753
770
        /* run through the message and check for custom emoticons and markup */