Changeset 3fbce97 for irc_channel.c


Ignore:
Timestamp:
2016-09-24T20:14:34Z (8 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
ba52ac5
Parents:
63cad66 (diff), 82cb190 (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.
Message:

Merge branch 'master' into parson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    r63cad66 r3fbce97  
    213213        }
    214214
     215        /* Skip the free/init if nothing is being changed */
     216        if (ic->f == new) {
     217                return value;
     218        }
     219
    215220        /* TODO: Return values. */
    216221        if (ic->f && ic->f->_free) {
     
    255260
    256261        if (!(icu = irc_channel_has_user(ic, iu))) {
     262                if (iu == ic->irc->user && type == IRC_CDU_KICK) {
     263                        /* an error happened before joining, inform the client with a numeric */
     264                        irc_send_num(ic->irc, 403, "%s :Error joining channel (check control channel?)", ic->name);
     265                }
    257266                return 0;
    258267        }
     
    427436                          changes);
    428437        }
     438}
     439
     440char irc_channel_user_get_prefix(irc_channel_user_t *icu)
     441{
     442        if (icu->flags & IRC_CHANNEL_USER_OP) {
     443                return '@';
     444        } else if (icu->flags & IRC_CHANNEL_USER_HALFOP) {
     445                return '%';
     446        } else if (icu->flags & IRC_CHANNEL_USER_VOICE) {
     447                return '+';
     448        }
     449        return 0;
    429450}
    430451
     
    593614
    594615        translit_name = g_convert_with_fallback(hint, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
     616
     617        if (!translit_name) {
     618                /* Same thing as in nick_gen() in nick.c, try again without //TRANSLIT */
     619                translit_name = g_convert_with_fallback(hint, -1, "ASCII", "UTF-8", "", NULL, &bytes_written, NULL);
     620        }
     621
     622        if (!translit_name) {
     623                return NULL;
     624        }
     625
    595626        if (bytes_written > MAX_NICK_LENGTH) {
    596627                translit_name[MAX_NICK_LENGTH] = '\0';
Note: See TracChangeset for help on using the changeset viewer.