[5ebff60] | 1 | /********************************************************************\ |
---|
[b7d3cc34] | 2 | * BitlBee -- An IRC to other IM-networks gateway * |
---|
| 3 | * * |
---|
[4e4af1b] | 4 | * Copyright 2002-2010 Wilmer van der Gaast and others * |
---|
[b7d3cc34] | 5 | \********************************************************************/ |
---|
| 6 | |
---|
| 7 | /* MSN module - Some tables with useful data */ |
---|
| 8 | |
---|
| 9 | /* |
---|
| 10 | This program is free software; you can redistribute it and/or modify |
---|
| 11 | it under the terms of the GNU General Public License as published by |
---|
| 12 | the Free Software Foundation; either version 2 of the License, or |
---|
| 13 | (at your option) any later version. |
---|
| 14 | |
---|
| 15 | This program is distributed in the hope that it will be useful, |
---|
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 18 | GNU General Public License for more details. |
---|
| 19 | |
---|
| 20 | You should have received a copy of the GNU General Public License with |
---|
| 21 | the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; |
---|
[6f10697] | 22 | if not, write to the Free Software Foundation, Inc., 51 Franklin St., |
---|
| 23 | Fifth Floor, Boston, MA 02110-1301 USA |
---|
[b7d3cc34] | 24 | */ |
---|
| 25 | |
---|
| 26 | #include "nogaim.h" |
---|
| 27 | #include "msn.h" |
---|
| 28 | |
---|
[0196c47] | 29 | const struct msn_away_state msn_away_state_list[] = |
---|
[b7d3cc34] | 30 | { |
---|
[b051d39] | 31 | { "NLN", "" }, |
---|
[0714d51] | 32 | { "AWY", "Away" }, |
---|
[b051d39] | 33 | { "BSY", "Busy" }, |
---|
| 34 | { "IDL", "Idle" }, |
---|
| 35 | { "BRB", "Be Right Back" }, |
---|
| 36 | { "PHN", "On the Phone" }, |
---|
| 37 | { "LUN", "Out to Lunch" }, |
---|
| 38 | { "HDN", "Hidden" }, |
---|
| 39 | { "", "" } |
---|
[b7d3cc34] | 40 | }; |
---|
| 41 | |
---|
[5ebff60] | 42 | const struct msn_away_state *msn_away_state_by_code(char *code) |
---|
[b7d3cc34] | 43 | { |
---|
| 44 | int i; |
---|
[5ebff60] | 45 | |
---|
| 46 | for (i = 0; *msn_away_state_list[i].code; i++) { |
---|
| 47 | if (g_strcasecmp(msn_away_state_list[i].code, code) == 0) { |
---|
| 48 | return(msn_away_state_list + i); |
---|
| 49 | } |
---|
| 50 | } |
---|
| 51 | |
---|
[b051d39] | 52 | return NULL; |
---|
[b7d3cc34] | 53 | } |
---|
| 54 | |
---|
[5ebff60] | 55 | const struct msn_away_state *msn_away_state_by_name(char *name) |
---|
[b7d3cc34] | 56 | { |
---|
| 57 | int i; |
---|
[5ebff60] | 58 | |
---|
| 59 | for (i = 0; *msn_away_state_list[i].code; i++) { |
---|
| 60 | if (g_strcasecmp(msn_away_state_list[i].name, name) == 0) { |
---|
| 61 | return(msn_away_state_list + i); |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
[b051d39] | 65 | return NULL; |
---|
[b7d3cc34] | 66 | } |
---|
| 67 | |
---|
[0196c47] | 68 | const struct msn_status_code msn_status_code_list[] = |
---|
[b7d3cc34] | 69 | { |
---|
| 70 | { 200, "Invalid syntax", 0 }, |
---|
| 71 | { 201, "Invalid parameter", 0 }, |
---|
| 72 | { 205, "Invalid (non-existent) handle", 0 }, |
---|
| 73 | { 206, "Domain name missing", 0 }, |
---|
| 74 | { 207, "Already logged in", 0 }, |
---|
[11e42dc] | 75 | { 208, "Invalid handle", 0 }, |
---|
[b7d3cc34] | 76 | { 209, "Forbidden nickname", 0 }, |
---|
| 77 | { 210, "Buddy list too long", 0 }, |
---|
| 78 | { 215, "Handle is already in list", 0 }, |
---|
[11e42dc] | 79 | { 216, "Handle is not in list", 0 }, |
---|
| 80 | { 217, "Person is off-line or non-existent", 0 }, |
---|
[b7d3cc34] | 81 | { 218, "Already in that mode", 0 }, |
---|
| 82 | { 219, "Handle is already in opposite list", 0 }, |
---|
| 83 | { 223, "Too many groups", 0 }, |
---|
| 84 | { 224, "Invalid group or already in list", 0 }, |
---|
| 85 | { 225, "Handle is not in that group", 0 }, |
---|
| 86 | { 229, "Group name too long", 0 }, |
---|
| 87 | { 230, "Cannot remove that group", 0 }, |
---|
| 88 | { 231, "Invalid group", 0 }, |
---|
[4fc95c5] | 89 | { 240, "ADL/RML command with corrupted payload", STATUS_FATAL }, |
---|
[00374ac] | 90 | { 241, "ADL/RML command with invalid modification", 0 }, |
---|
[b7d3cc34] | 91 | { 280, "Switchboard failed", STATUS_SB_FATAL }, |
---|
| 92 | { 281, "Transfer to switchboard failed", 0 }, |
---|
[5ebff60] | 93 | |
---|
[b7d3cc34] | 94 | { 300, "Required field missing", 0 }, |
---|
| 95 | { 302, "Not logged in", 0 }, |
---|
[5ebff60] | 96 | |
---|
[b7d3cc34] | 97 | { 500, "Internal server error/Account banned", STATUS_FATAL }, |
---|
| 98 | { 501, "Database server error", STATUS_FATAL }, |
---|
| 99 | { 502, "Command disabled", 0 }, |
---|
| 100 | { 510, "File operation failed", STATUS_FATAL }, |
---|
| 101 | { 520, "Memory allocation failed", STATUS_FATAL }, |
---|
| 102 | { 540, "Challenge response invalid", STATUS_FATAL }, |
---|
[5ebff60] | 103 | |
---|
[b7d3cc34] | 104 | { 600, "Server is busy", STATUS_FATAL }, |
---|
| 105 | { 601, "Server is unavailable", STATUS_FATAL }, |
---|
| 106 | { 602, "Peer nameserver is down", STATUS_FATAL }, |
---|
| 107 | { 603, "Database connection failed", STATUS_FATAL }, |
---|
| 108 | { 604, "Server is going down", STATUS_FATAL }, |
---|
| 109 | { 605, "Server is unavailable", STATUS_FATAL }, |
---|
[5ebff60] | 110 | |
---|
[b7d3cc34] | 111 | { 700, "Could not create connection", STATUS_FATAL }, |
---|
| 112 | { 710, "Invalid CVR parameters", STATUS_FATAL }, |
---|
| 113 | { 711, "Write is blocking", STATUS_FATAL }, |
---|
| 114 | { 712, "Session is overloaded", STATUS_FATAL }, |
---|
[11e42dc] | 115 | { 713, "Calling too rapidly", 0 }, |
---|
[b7d3cc34] | 116 | { 714, "Too many sessions", STATUS_FATAL }, |
---|
| 117 | { 715, "Not expected/Invalid argument/action", 0 }, |
---|
| 118 | { 717, "Bad friend file", STATUS_FATAL }, |
---|
| 119 | { 731, "Not expected/Invalid argument", 0 }, |
---|
[5ebff60] | 120 | |
---|
[b7d3cc34] | 121 | { 800, "Changing too rapidly", 0 }, |
---|
[5ebff60] | 122 | |
---|
[b7d3cc34] | 123 | { 910, "Server is busy", STATUS_FATAL }, |
---|
[6048744] | 124 | { 911, "Authentication failed", STATUS_SB_FATAL | STATUS_FATAL }, |
---|
[b7d3cc34] | 125 | { 912, "Server is busy", STATUS_FATAL }, |
---|
| 126 | { 913, "Not allowed when hiding", 0 }, |
---|
| 127 | { 914, "Server is unavailable", STATUS_FATAL }, |
---|
| 128 | { 915, "Server is unavailable", STATUS_FATAL }, |
---|
| 129 | { 916, "Server is unavailable", STATUS_FATAL }, |
---|
| 130 | { 917, "Authentication failed", STATUS_FATAL }, |
---|
| 131 | { 918, "Server is busy", STATUS_FATAL }, |
---|
| 132 | { 919, "Server is busy", STATUS_FATAL }, |
---|
| 133 | { 920, "Not accepting new principals", 0 }, /* When a sb is full? */ |
---|
| 134 | { 922, "Server is busy", STATUS_FATAL }, |
---|
| 135 | { 923, "Kids Passport without parental consent", STATUS_FATAL }, |
---|
| 136 | { 924, "Passport account not yet verified", STATUS_FATAL }, |
---|
| 137 | { 928, "Bad ticket", STATUS_FATAL }, |
---|
| 138 | { -1, NULL, 0 } |
---|
| 139 | }; |
---|
| 140 | |
---|
[5ebff60] | 141 | const struct msn_status_code *msn_status_by_number(int number) |
---|
[b7d3cc34] | 142 | { |
---|
| 143 | static struct msn_status_code *unknown = NULL; |
---|
| 144 | int i; |
---|
[5ebff60] | 145 | |
---|
| 146 | for (i = 0; msn_status_code_list[i].number >= 0; i++) { |
---|
| 147 | if (msn_status_code_list[i].number == number) { |
---|
| 148 | return(msn_status_code_list + i); |
---|
| 149 | } |
---|
[b7d3cc34] | 150 | } |
---|
[5ebff60] | 151 | |
---|
| 152 | if (unknown == NULL) { |
---|
| 153 | unknown = g_new0(struct msn_status_code, 1); |
---|
| 154 | unknown->text = g_new0(char, 128); |
---|
| 155 | } |
---|
| 156 | |
---|
[b7d3cc34] | 157 | unknown->number = number; |
---|
| 158 | unknown->flags = 0; |
---|
[5ebff60] | 159 | g_snprintf(unknown->text, 128, "Unknown error (%d)", number); |
---|
| 160 | |
---|
| 161 | return(unknown); |
---|
[b7d3cc34] | 162 | } |
---|