Changeset 7733b8c for root_commands.c


Ignore:
Timestamp:
2015-02-21T06:10:54Z (10 years ago)
Author:
dequis <dx@…>
Children:
75ad761
Parents:
5ebff60
git-author:
dequis <dx@…> (19-07-14 04:51:58)
git-committer:
dequis <dx@…> (21-02-15 06:10:54)
Message:

Add the concept of jabber sub-protocols

Currently including: jabber (none), gtalk, facebook, hipchat.

They provide a default server field and an oauth service definition.

Also the "account tag guesses" become subprotocol guesses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r5ebff60 r7733b8c  
    395395        if (len >= 1 && g_strncasecmp(cmd[1], "add", len) == 0) {
    396396                struct prpl *prpl;
     397                char *protocol_name = cmd[2];
    397398
    398399                MIN_ARGS(3);
     
    410411                }
    411412
    412                 prpl = find_protocol(cmd[2]);
     413                /* These used to be just hardcoded account tag guesses,
     414                 * now they are promoted to hardecoded subprotocol guesses */
     415                if (strcmp(protocol_name, "jabber") == 0) {
     416                        if (strstr(cmd[3], "@gmail.com") || strstr(cmd[3], "@googlemail.com")) {
     417                                protocol_name = "gtalk";
     418                        } else if (strstr(cmd[3], "@chat.facebook.com")) {
     419                                protocol_name = "fb";
     420                        }
     421                }
     422
     423                prpl = find_protocol(protocol_name);
    413424
    414425                if (prpl == NULL) {
Note: See TracChangeset for help on using the changeset viewer.