tools/jabberd14sql2prosody.lua
author Matthew Wild <mwild1@gmail.com>
Sun, 17 Mar 2024 10:10:24 +0000
changeset 13464 a688947fab1e
parent 13146 879a6a33c21b
permissions -rw-r--r--
mod_bosh: Set base_type on session This fixes a traceback with mod_saslauth. Ideally we move this to util.session at some point, though.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/env lua
13146
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
     2
if not pcall(require, "prosody.loader") then
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
     3
	pcall(require, "loader");
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
     4
end
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
     5
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
     6
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
     7
do
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
     8
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
     9
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    10
local _parse_sql_actions = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    11
  0, 1, 0, 1, 1, 2, 0, 2, 2, 0, 9, 2, 0, 10, 2, 0, 11, 2, 0, 13,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    12
  2, 1, 2, 2, 1, 6, 3, 0, 3, 4, 3, 0, 3, 5, 3, 0, 3, 7, 3, 0,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    13
  3, 8, 3, 0, 3, 12, 4, 0, 2, 3, 7, 4, 0, 3, 8, 11
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    14
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    15
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    16
local _parse_sql_trans_keys = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    17
  0, 0, 45, 45, 10, 10, 42, 42, 10, 42, 10, 47, 82, 82,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    18
  69, 69, 65, 65, 84, 84, 69, 69, 32, 32, 68, 84, 65,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    19
  65, 84, 84, 65, 65, 66, 66, 65, 65, 83, 83, 69, 69,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    20
  9, 47, 9, 96, 45, 45, 10, 10, 42, 42, 10, 42, 10, 47,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    21
  10, 96, 10, 96, 9, 47, 9, 59, 45, 45, 10, 10, 42,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    22
  42, 10, 42, 10, 47, 65, 65, 66, 66, 76, 76, 69, 69,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    23
  32, 32, 73, 96, 70, 70, 32, 32, 78, 78, 79, 79, 84, 84,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    24
  32, 32, 69, 69, 88, 88, 73, 73, 83, 83, 84, 84, 83,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    25
  83, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 40, 40,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    26
  10, 10, 32, 41, 32, 32, 75, 96, 69, 69, 89, 89, 32, 32,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    27
  96, 96, 10, 96, 10, 96, 10, 10, 82, 82, 73, 73, 77,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    28
  77, 65, 65, 82, 82, 89, 89, 32, 32, 75, 75, 69, 69,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    29
  89, 89, 32, 32, 78, 78, 73, 73, 81, 81, 85, 85, 69, 69,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    30
  32, 32, 75, 75, 10, 96, 10, 96, 10, 10, 10, 59, 10,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    31
  59, 82, 82, 79, 79, 80, 80, 32, 32, 84, 84, 65, 65,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    32
  66, 66, 76, 76, 69, 69, 32, 32, 73, 73, 70, 70, 32, 32,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    33
  69, 69, 88, 88, 73, 73, 83, 83, 84, 84, 83, 83, 32,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    34
  32, 96, 96, 10, 96, 10, 96, 59, 59, 78, 78, 83, 83,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    35
  69, 69, 82, 82, 84, 84, 32, 32, 73, 73, 78, 78, 84, 84,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    36
  79, 79, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 40,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    37
  86, 10, 41, 32, 32, 86, 86, 65, 65, 76, 76, 85, 85,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    38
  69, 69, 83, 83, 32, 32, 40, 40, 39, 78, 10, 92, 10, 92,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    39
  41, 44, 44, 59, 32, 78, 48, 57, 41, 57, 48, 57, 41,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    40
  57, 85, 85, 76, 76, 76, 76, 34, 116, 79, 79, 67, 67,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    41
  75, 75, 32, 32, 84, 84, 65, 65, 66, 66, 76, 76, 69, 69,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    42
  83, 83, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 87,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    43
  87, 82, 82, 73, 73, 84, 84, 69, 69, 69, 69, 84, 84,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    44
  32, 32, 10, 59, 10, 59, 78, 83, 76, 76, 79, 79, 67, 67,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    45
  75, 75, 32, 32, 84, 84, 65, 65, 66, 66, 76, 76, 69,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    46
  69, 83, 83, 69, 69, 9, 85, 0
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    47
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    48
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    49
local _parse_sql_key_spans = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    50
  0, 1, 1, 1, 33, 38, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    51
  39, 88, 1, 1, 1, 33, 38, 87, 87, 39, 51, 1, 1, 1, 33, 38, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    52
  1, 24, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    53
  1, 10, 1, 22, 1, 1, 1, 1, 87, 87, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    54
  1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 50, 50, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    55
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    56
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 47, 32, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    57
  1, 1, 1, 1, 40, 83, 83, 4, 16, 47, 10, 17, 10, 17, 1, 1, 1, 83, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    58
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 1, 1, 1, 1, 1, 1,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    59
  1, 50, 50, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 77
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    60
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    61
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    62
local _parse_sql_index_offsets = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    63
  0, 0, 2, 4, 6, 40, 79, 81, 83, 85, 87, 89, 91, 109, 111, 113, 115, 117, 119, 121,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    64
  123, 163, 252, 254, 256, 258, 292, 331, 419, 507, 547, 599, 601, 603, 605, 639, 678, 680, 682, 684,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    65
  686, 688, 713, 715, 717, 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, 741, 829, 917, 919,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    66
  921, 923, 934, 936, 959, 961, 963, 965, 967, 1055, 1143, 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1159, 1161,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    67
  1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1269, 1357, 1359, 1410, 1461, 1463, 1465, 1467, 1469, 1471,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    68
  1473, 1475, 1477, 1479, 1481, 1483, 1485, 1487, 1489, 1491, 1493, 1495, 1497, 1499, 1501, 1503, 1591, 1679, 1681, 1683,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    69
  1685, 1687, 1689, 1691, 1693, 1695, 1697, 1699, 1701, 1703, 1705, 1793, 1881, 1883, 1931, 1964, 1966, 1968, 1970, 1972,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    70
  1974, 1976, 1978, 1980, 1982, 2023, 2107, 2191, 2196, 2213, 2261, 2272, 2290, 2301, 2319, 2321, 2323, 2325, 2409, 2411,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    71
  2413, 2415, 2417, 2419, 2421, 2423, 2425, 2427, 2429, 2431, 2433, 2521, 2609, 2611, 2613, 2615, 2617, 2619, 2621, 2623,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    72
  2625, 2627, 2678, 2729, 2736, 2738, 2740, 2742, 2744, 2746, 2748, 2750, 2752, 2754, 2756, 2758, 2760
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    73
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    74
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
    75
local _parse_sql_indicies = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    76
  0, 1, 2, 0, 3, 1, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    77
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    78
  4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    79
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 6, 3, 7,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    80
  1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    81
  1, 1, 1, 1, 1, 1, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    82
  1, 21, 1, 22, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    83
  1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    84
  1, 25, 1, 22, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    85
  1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    86
  1, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    87
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    88
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 26, 1, 27, 1, 23, 27, 28, 1, 29, 28,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    89
  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    90
  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 29, 28, 28, 28, 28, 28, 28, 28,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    91
  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    92
  28, 28, 28, 28, 30, 28, 28, 28, 28, 22, 28, 32, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    93
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    94
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    95
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    96
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 1, 31, 32,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    97
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    98
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
    99
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   100
  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   101
  31, 31, 31, 31, 31, 33, 31, 34, 35, 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   102
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   103
  1, 1, 1, 36, 1, 37, 1, 34, 35, 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   104
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   105
  1, 1, 1, 36, 1, 37, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 38,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   106
  1, 35, 38, 39, 1, 40, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   107
  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 39, 40,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   108
  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   109
  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 39, 39, 39, 39, 34, 39, 42, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   110
  43, 1, 44, 1, 45, 1, 46, 1, 47, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   111
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 48, 1, 49, 1, 50, 1, 51, 1, 52,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   112
  1, 53, 1, 54, 1, 55, 1, 56, 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 48,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   113
  1, 63, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   114
  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   115
  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   116
  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   117
  62, 62, 62, 62, 62, 62, 62, 1, 62, 65, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   118
  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   119
  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   120
  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   121
  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 66, 64, 67, 1, 68,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   122
  1, 69, 1, 70, 1, 1, 1, 1, 1, 1, 1, 1, 71, 1, 72, 1, 73, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   123
  1, 74, 1, 1, 1, 1, 75, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 1, 77,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   124
  1, 78, 1, 79, 1, 80, 1, 82, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   125
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   126
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   127
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   128
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 1, 81, 82, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   129
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   130
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   131
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   132
  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   133
  81, 83, 81, 69, 83, 84, 1, 85, 1, 86, 1, 87, 1, 88, 1, 89, 1, 90, 1, 91,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   134
  1, 92, 1, 93, 1, 83, 1, 94, 1, 95, 1, 96, 1, 97, 1, 98, 1, 99, 1, 73,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   135
  1, 101, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   136
  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   137
  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   138
  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   139
  100, 100, 100, 100, 100, 100, 100, 1, 100, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   140
  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   141
  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   142
  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   143
  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 104, 102, 105, 83, 106,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   144
  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   145
  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   146
  71, 71, 71, 71, 71, 71, 71, 71, 107, 71, 108, 71, 71, 71, 71, 71, 71, 71, 71, 71,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   147
  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   148
  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 107,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   149
  71, 109, 1, 110, 1, 111, 1, 112, 1, 113, 1, 114, 1, 115, 1, 116, 1, 117, 1, 118,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   150
  1, 119, 1, 120, 1, 121, 1, 122, 1, 123, 1, 124, 1, 125, 1, 126, 1, 127, 1, 128,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   151
  1, 129, 1, 131, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   152
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   153
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   154
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   155
  130, 130, 130, 130, 130, 130, 130, 130, 130, 1, 130, 131, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   156
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   157
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   158
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   159
  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 132, 130, 6,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   160
  1, 133, 1, 134, 1, 135, 1, 136, 1, 137, 1, 138, 1, 139, 1, 140, 1, 141, 1, 142,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   161
  1, 143, 1, 144, 1, 146, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   162
  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   163
  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   164
  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   165
  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 1, 145, 148, 147, 147, 147, 147, 147, 147,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   166
  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   167
  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   168
  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   169
  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 149,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   170
  147, 150, 1, 151, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   171
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   172
  1, 1, 1, 1, 1, 1, 1, 1, 1, 152, 1, 153, 151, 151, 151, 151, 151, 151, 151, 151,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   173
  151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   174
  151, 151, 154, 151, 155, 1, 152, 1, 156, 1, 157, 1, 158, 1, 159, 1, 160, 1, 161, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   175
  162, 1, 163, 1, 1, 1, 1, 1, 164, 1, 1, 165, 165, 165, 165, 165, 165, 165, 165, 165,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   176
  165, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   177
  1, 166, 1, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   178
  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 169, 167, 167, 167, 167, 167, 167, 167,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   179
  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   180
  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   181
  167, 167, 167, 167, 167, 170, 167, 172, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   182
  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 173, 171, 171, 171,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   183
  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   184
  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   185
  171, 171, 171, 171, 171, 171, 171, 171, 171, 174, 171, 175, 1, 1, 176, 1, 161, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   186
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 177, 1, 178, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   187
  163, 1, 1, 1, 1, 1, 164, 1, 1, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   188
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 166,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   189
  1, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 1, 180, 1, 1, 181, 1, 182, 1, 179,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   190
  179, 179, 179, 179, 179, 179, 179, 179, 179, 1, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   191
  1, 180, 1, 1, 181, 1, 1, 1, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 1, 184,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   192
  1, 185, 1, 186, 1, 171, 1, 1, 171, 1, 171, 1, 1, 1, 1, 1, 1, 1, 1, 171,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   193
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   194
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   195
  1, 171, 1, 171, 1, 1, 171, 1, 1, 171, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   196
  1, 171, 1, 1, 1, 171, 1, 171, 1, 187, 1, 188, 1, 189, 1, 190, 1, 191, 1, 192,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   197
  1, 193, 1, 194, 1, 195, 1, 196, 1, 197, 1, 198, 1, 200, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   198
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   199
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   200
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   201
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   202
  199, 200, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   203
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   204
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   205
  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   206
  199, 199, 199, 199, 199, 199, 199, 201, 199, 202, 1, 203, 1, 204, 1, 205, 1, 206, 1, 132,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   207
  1, 207, 1, 208, 1, 209, 1, 210, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   208
  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   209
  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 211, 209, 2, 209,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   210
  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   211
  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   212
  209, 209, 209, 209, 209, 209, 209, 211, 209, 212, 1, 1, 1, 1, 213, 1, 214, 1, 215, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   213
  216, 1, 217, 1, 218, 1, 219, 1, 220, 1, 221, 1, 222, 1, 223, 1, 132, 1, 127, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   214
  6, 2, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   215
  1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 224, 1, 225, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   216
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 226, 227,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   217
  1, 1, 1, 1, 228, 1, 1, 229, 1, 1, 1, 1, 1, 1, 230, 1, 231, 1, 0
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   218
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   219
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   220
local _parse_sql_trans_targs = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   221
  2, 0, 196, 4, 4, 5, 196, 7, 8, 9, 10, 11, 12, 13, 36, 14, 15, 16, 17, 18,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   222
  19, 20, 21, 21, 22, 24, 27, 23, 25, 25, 26, 28, 28, 29, 30, 30, 31, 33, 32, 34,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   223
  34, 35, 37, 38, 39, 40, 41, 42, 56, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   224
  54, 55, 57, 57, 57, 57, 58, 59, 60, 61, 62, 92, 63, 64, 71, 82, 89, 65, 66, 67,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   225
  68, 69, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   226
  90, 90, 90, 90, 91, 70, 92, 93, 196, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   227
  106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 116, 117, 119, 120, 121, 122, 123, 124, 125,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   228
  126, 127, 128, 129, 130, 131, 131, 131, 131, 132, 133, 134, 137, 134, 135, 136, 138, 139, 140, 141,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   229
  142, 143, 144, 145, 150, 151, 154, 146, 146, 147, 157, 146, 146, 147, 157, 148, 149, 196, 144, 151,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   230
  148, 149, 152, 153, 155, 156, 147, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   231
  171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 181, 182, 184, 195, 185, 186, 187, 188, 189, 190,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   232
  191, 192, 193, 194, 1, 3, 6, 94, 118, 158, 178, 183
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   233
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   234
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   235
local _parse_sql_trans_actions = { [0] =
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   236
  1, 0, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   237
  1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   238
  3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   239
  1, 1, 5, 20, 1, 3, 30, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   240
  1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   241
  5, 20, 1, 3, 26, 3, 3, 1, 23, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   242
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   243
  1, 1, 1, 1, 1, 5, 20, 1, 3, 42, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   244
  1, 1, 11, 1, 5, 5, 1, 5, 20, 46, 5, 1, 3, 34, 1, 14, 1, 17, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   245
  51, 38, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   246
  3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   247
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   248
};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   249
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   250
local parse_sql_start = 196;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   251
local parse_sql_first_final = 196;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   252
local parse_sql_error = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   253
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   254
local parse_sql_en_main = 196;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   255
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   256
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   257
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   258
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   259
local _sql_unescapes = setmetatable({
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   260
	["\\0"] = "\0";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   261
	["\\'"] = "'";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   262
	["\\\""] = "\"";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   263
	["\\b"] = "\b";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   264
	["\\n"] = "\n";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   265
	["\\r"] = "\r";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   266
	["\\t"] = "\t";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   267
	["\\Z"] = "\26";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   268
	["\\\\"] = "\\";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   269
	["\\%"] = "%";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   270
	["\\_"] = "_";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   271
},{ __index = function(t, s) assert(false, "Unknown escape sequences: "..s); end });
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   272
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   273
function parse_sql(data, h)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   274
	local p = 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   275
	local pe = #data + 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   276
	local cs;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   277
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   278
	local pos_char, pos_line = 1, 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   279
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   280
	local mark, token;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   281
	local table_name, columns, value_lists, value_list, value_count;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   282
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   283
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   284
  cs = parse_sql_start;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   285
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   286
--  ragel flat exec
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   287
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   288
  local testEof = false;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   289
  local _slen = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   290
  local _trans = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   291
  local _keys = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   292
  local _inds = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   293
  local _acts = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   294
  local _nacts = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   295
  local _tempval = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   296
  local _goto_level = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   297
  local _resume = 10;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   298
  local _eof_trans = 15;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   299
  local _again = 20;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   300
  local _test_eof = 30;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   301
  local _out = 40;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   302
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   303
  while true do -- goto loop
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   304
  local _continue = false;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   305
  repeat
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   306
    local _trigger_goto = false;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   307
    if _goto_level <= 0 then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   308
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   309
-- noEnd
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   310
      if p == pe then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   311
        _goto_level = _test_eof;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   312
        _continue = true; break;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   313
      end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   314
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   315
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   316
-- errState != 0
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   317
      if cs == 0 then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   318
        _goto_level = _out;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   319
       _continue = true; break;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   320
      end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   321
    end -- _goto_level <= 0
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   322
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   323
     if _goto_level <= _resume then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   324
      _keys = cs * 2; -- LOCATE_TRANS
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   325
      _inds = _parse_sql_index_offsets[cs];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   326
      _slen = _parse_sql_key_spans[cs];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   327
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   328
      if   _slen > 0 and
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   329
         _parse_sql_trans_keys[_keys] <= data:byte(p) and
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   330
         data:byte(p) <= _parse_sql_trans_keys[_keys + 1] then
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   331
        _trans = _parse_sql_indicies[ _inds + data:byte(p) - _parse_sql_trans_keys[_keys] ];
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   332
      else _trans =_parse_sql_indicies[ _inds + _slen ]; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   333
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   334
    cs = _parse_sql_trans_targs[_trans];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   335
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   336
    if _parse_sql_trans_actions[_trans] ~= 0 then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   337
      _acts = _parse_sql_trans_actions[_trans];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   338
      _nacts = _parse_sql_actions[_acts];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   339
      _acts = _acts + 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   340
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   341
      while _nacts > 0 do
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   342
        _nacts = _nacts - 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   343
        _acts = _acts + 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   344
        _tempval = _parse_sql_actions[_acts - 1];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   345
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   346
     -- start action switch
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   347
        if _tempval  == 0 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   348
-- line 34 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   349
       pos_char = pos_char + 1;       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   350
        elseif _tempval  == 1 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   351
-- line 35 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   352
       pos_line = pos_line + 1; pos_char = 1;       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   353
        elseif _tempval  == 2 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   354
-- line 38 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   355
       mark = p;       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   356
        elseif _tempval  == 3 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   357
-- line 39 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   358
       token = data:sub(mark, p-1);       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   359
        elseif _tempval  == 4 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   360
-- line 52 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   361
       table.insert(columns, token); columns[#columns] = token;       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   362
        elseif _tempval  == 5 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   363
-- line 58 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   364
       table_name,columns = token,{};       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   365
        elseif _tempval  == 6 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   366
-- line 59 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   367
       h.create(table_name, columns);       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   368
        elseif _tempval  == 7 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   369
-- line 65 "sql.rl" -- end of line directive
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   370
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   371
			value_count = value_count + 1; value_list[value_count] = token:gsub("\\.", _sql_unescapes);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   372
		      -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   373
        elseif _tempval  == 8 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   374
-- line 68 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   375
       value_count = value_count + 1; value_list[value_count] = tonumber(token);       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   376
        elseif _tempval  == 9 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   377
-- line 69 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   378
       value_count = value_count + 1;       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   379
        elseif _tempval  == 10 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   380
-- line 71 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   381
       value_list,value_count = {},0;       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   382
        elseif _tempval  == 11 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   383
-- line 71 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   384
       table.insert(value_lists, value_list);       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   385
        elseif _tempval  == 12 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   386
-- line 74 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   387
       table_name,value_lists = token,{};       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   388
        elseif _tempval  == 13 then --4 FROM_STATE_ACTION_SWITCH
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   389
-- line 75 "sql.rl" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   390
       h.insert(table_name, value_lists);       -- ACTION
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   391
        end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   392
-- line 355 "sql.lua" -- end of line directive
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   393
    -- end action switch
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   394
      end -- while _nacts
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   395
    end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   396
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   397
    if _trigger_goto then _continue = true; break; end
5776
bd0ff8ae98a8 Remove all trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents: 5696
diff changeset
   398
    end -- endif
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   399
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   400
    if _goto_level <= _again then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   401
      if cs == 0 then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   402
        _goto_level = _out;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   403
        _continue = true; break;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   404
      end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   405
      p = p + 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   406
      if p ~= pe then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   407
        _goto_level = _resume;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   408
        _continue = true; break;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   409
      end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   410
    end -- _goto_level <= _again
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   411
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   412
    if _goto_level <= _test_eof then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   413
    end -- _goto_level <= _test_eof
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   414
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   415
    if _goto_level <= _out then break; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   416
  _continue = true;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   417
  until true;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   418
  if not _continue then break; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   419
  end -- endif _goto_level <= out
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   420
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   421
  -- end of execute block
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   422
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   423
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   424
	if cs < parse_sql_first_final then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   425
		print("parse_sql: there was an error, line "..pos_line.." column "..pos_char);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   426
	else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   427
		print("Success. EOF at line "..pos_line.." column "..pos_char)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   428
	end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   429
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   430
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   431
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   432
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   433
-- import modules
6147
852bd69ba148 tools/jabberd14sql2prosody: Fix package.path (thanks daurnimator)
Kim Alvefur <zash@zash.se>
parents: 5696
diff changeset
   434
package.path = package.path..";../?.lua;";
5696
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   435
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   436
local my_name = arg[0];
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   437
if my_name:match("[/\\]") then
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   438
	package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   439
	package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   440
end
9fba74a28e0c package{,c}path fixes for migration tools
Vadim Misbakh-Soloviov <mva@mva.name>
parents: 5216
diff changeset
   441
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   442
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   443
-- ugly workaround for getting datamanager to work outside of prosody :(
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   444
prosody = { };
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   445
prosody.platform = "unknown";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   446
if os.getenv("WINDIR") then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   447
	prosody.platform = "windows";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   448
elseif package.config:sub(1,1) == "/" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   449
	prosody.platform = "_posix";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   450
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   451
package.loaded["util.logger"] = {init = function() return function() end; end}
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   452
13146
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
   453
local dm = require "prosody.util.datamanager";
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   454
dm.set_data_path("data");
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   455
13146
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
   456
local datetime = require "prosody.util.datetime";
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   457
13146
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
   458
local st = require "prosody.util.stanza";
879a6a33c21b tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se>
parents: 11685
diff changeset
   459
local parse_xml = require "prosody.util.xml".parse;
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   460
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   461
function store_password(username, host, password)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   462
	-- create or update account for username@host
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   463
	local ret, err = dm.store(username, host, "accounts", {password = password});
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   464
	print("["..(err or "success").."] stored account: "..username.."@"..host.." = "..password);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   465
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   466
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   467
function store_vcard(username, host, stanza)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   468
	-- create or update vCard for username@host
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   469
	local ret, err = dm.store(username, host, "vcard", st.preserialize(stanza));
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   470
	print("["..(err or "success").."] stored vCard: "..username.."@"..host);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   471
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   472
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   473
function store_roster(username, host, roster_items)
11685
e270d22b11d9 tools/jabberd14sql2prosody: Tweak wording in comments
Kim Alvefur <zash@zash.se>
parents: 6149
diff changeset
   474
	-- fetch current roster-table for username@host if they already have one
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   475
	local roster = dm.load(username, host, "roster") or {};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   476
	-- merge imported roster-items with loaded roster
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   477
	for item_tag in roster_items:childtags() do
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   478
		-- jid for this roster-item
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   479
		local item_jid = item_tag.attr.jid
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   480
		-- validate item stanzas
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   481
		if (item_tag.name == "item") and (item_jid ~= "") then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   482
			-- prepare roster item
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   483
			-- TODO: is the subscription attribute optional?
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   484
			local item = {subscription = item_tag.attr.subscription, groups = {}};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   485
			-- optional: give roster item a real name
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   486
			if item_tag.attr.name then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   487
				item.name = item_tag.attr.name;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   488
			end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   489
			-- optional: iterate over group stanzas inside item stanza
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   490
			for group_tag in item_tag:childtags() do
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   491
				local group_name = group_tag:get_text();
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   492
				if (group_tag.name == "group") and (group_name ~= "") then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   493
					item.groups[group_name] = true;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   494
				else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   495
					print("[error] invalid group stanza: "..group_tag:pretty_print());
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   496
				end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   497
			end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   498
			-- store item in roster
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   499
			roster[item_jid] = item;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   500
			print("[success] roster entry: " ..username.."@"..host.." - "..item_jid);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   501
		else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   502
			print("[error] invalid roster stanza: " ..item_tag:pretty_print());
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   503
		end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   504
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   505
	end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   506
	-- store merged roster-table
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   507
	local ret, err = dm.store(username, host, "roster", roster);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   508
	print("["..(err or "success").."] stored roster: " ..username.."@"..host);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   509
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   510
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   511
function store_subscription_request(username, host, presence_stanza)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   512
	local from_bare = presence_stanza.attr.from;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   513
11685
e270d22b11d9 tools/jabberd14sql2prosody: Tweak wording in comments
Kim Alvefur <zash@zash.se>
parents: 6149
diff changeset
   514
	-- fetch current roster-table for username@host if they already have one
5109
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   515
	local roster = dm.load(username, host, "roster") or {};
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   516
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   517
	local item = roster[from_bare];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   518
	if item and (item.subscription == "from" or item.subscription == "both") then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   519
		return; -- already subscribed, do nothing
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   520
	end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   521
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   522
	-- add to table of pending subscriptions
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   523
	if not roster.pending then roster.pending = {}; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   524
	roster.pending[from_bare] = true;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   525
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   526
	-- store updated roster-table
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   527
	local ret, err = dm.store(username, host, "roster", roster);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   528
	print("["..(err or "success").."] stored subscription request: " ..username.."@"..host.." - "..from_bare);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   529
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   530
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   531
local os_date = os.date;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   532
local os_time = os.time;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   533
local os_difftime = os.difftime;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   534
function datetime_parse(s)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   535
	if s then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   536
		local year, month, day, hour, min, sec, tzd;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   537
		year, month, day, hour, min, sec, tzd = s:match("^(%d%d%d%d)%-?(%d%d)%-?(%d%d)T(%d%d):(%d%d):(%d%d)%.?%d*([Z+%-]?.*)$");
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   538
		if year then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   539
			local time_offset = os_difftime(os_time(os_date("*t")), os_time(os_date("!*t"))); -- to deal with local timezone
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   540
			local tzd_offset = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   541
			if tzd ~= "" and tzd ~= "Z" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   542
				local sign, h, m = tzd:match("([+%-])(%d%d):?(%d*)");
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   543
				if not sign then return; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   544
				if #m ~= 2 then m = "0"; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   545
				h, m = tonumber(h), tonumber(m);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   546
				tzd_offset = h * 60 * 60 + m * 60;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   547
				if sign == "-" then tzd_offset = -tzd_offset; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   548
			end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   549
			sec = (sec + time_offset) - tzd_offset;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   550
			return os_time({year=year, month=month, day=day, hour=hour, min=min, sec=sec, isdst=false});
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   551
		end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   552
	end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   553
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   554
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   555
function store_offline_messages(username, host, stanza)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   556
	-- TODO: maybe use list_load(), append and list_store() instead
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   557
	--       of constantly reopening the file with list_append()?
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   558
	--for ch in offline_messages:childtags() do
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   559
		--print("message :"..ch:pretty_print());
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   560
		stanza.attr.node = nil;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   561
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   562
		local stamp = stanza:get_child("x", "jabber:x:delay");
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   563
		if not stamp or not stamp.attr.stamp then print(2) return; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   564
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   565
		for i=1,#stanza do if stanza[i] == stamp then table.remove(stanza, i); break; end end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   566
		for i=1,#stanza.tags do if stanza.tags[i] == stamp then table.remove(stanza.tags, i); break; end end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   567
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   568
		local parsed_stamp = datetime_parse(stamp.attr.stamp);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   569
		if not parsed_stamp then print(1, stamp.attr.stamp) return; end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   570
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   571
		stanza.attr.stamp, stanza.attr.stamp_legacy = datetime.datetime(parsed_stamp), datetime.legacy(parsed_stamp);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   572
		local ret, err = dm.list_append(username, host, "offline", st.preserialize(stanza));
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   573
		print("["..(err or "success").."] stored offline message: " ..username.."@"..host.." - "..stanza.attr.from);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   574
	--end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   575
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   576
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   577
-- load data
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   578
local arg = ...;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   579
local help = "/? -? ? /h -h /help -help --help";
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   580
if not arg or help:find(arg, 1, true) then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   581
	print([[XEP-227 importer for Prosody
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   582
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   583
  Usage: jabberd14sql2prosody.lua filename.sql
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   584
]]);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   585
	os.exit(1);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   586
end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   587
local f = io.open(arg);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   588
local s = f:read("*a");
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   589
f:close();
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   590
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   591
local table_count = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   592
local insert_count = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   593
local row_count = 0;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   594
-- parse
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   595
parse_sql(s, {
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   596
	create = function(table_name, columns)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   597
		--[[print(table_name);]]
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   598
		table_count = table_count + 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   599
	end;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   600
	insert = function(table_name, value_lists)
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   601
		--[[print(table_name, #value_lists);]]
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   602
		insert_count = insert_count + 1;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   603
		row_count = row_count + #value_lists;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   604
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   605
		for _,value_list in ipairs(value_lists) do
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   606
			if table_name == "users" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   607
				local user, realm, password = unpack(value_list);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   608
				store_password(user, realm, password);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   609
			elseif table_name == "roster" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   610
				local user, realm, xml = unpack(value_list);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   611
				local stanza,err = parse_xml(xml);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   612
				if stanza then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   613
					store_roster(user, realm, stanza);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   614
				else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   615
					print("[error] roster: XML parsing failed for "..user.."@"..realm..": "..err);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   616
				end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   617
			elseif table_name == "vcard" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   618
				local user, realm, name, email, nickname, birthday, photo, xml = unpack(value_list);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   619
				if xml then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   620
					local stanza,err = parse_xml(xml);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   621
					if stanza then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   622
						store_vcard(user, realm, stanza);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   623
					else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   624
						print("[error] vcard: XML parsing failed for "..user.."@"..realm..": "..err);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   625
					end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   626
				else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   627
					--print("[warn] vcard: NULL vCard for "..user.."@"..realm..": "..err);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   628
				end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   629
			elseif table_name == "storedsubscriptionrequests" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   630
				local user, realm, fromjid, xml = unpack(value_list);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   631
				local stanza,err = parse_xml(xml);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   632
				if stanza then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   633
					store_subscription_request(user, realm, stanza);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   634
				else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   635
					print("[error] storedsubscriptionrequests: XML parsing failed for "..user.."@"..realm..": "..err);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   636
				end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   637
			elseif table_name == "messages" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   638
				--local user, realm, node, correspondent, type, storetime, delivertime, subject, body, xml = unpack(value_list);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   639
				local user, realm, type, xml = value_list[1], value_list[2], value_list[5], value_list[10];
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   640
				if type == "offline" and xml ~= "" then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   641
					local stanza,err = parse_xml(xml);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   642
					if stanza then
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   643
						store_offline_messages(user, realm, stanza);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   644
					else
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   645
						print("[error] offline messages: XML parsing failed for "..user.."@"..realm..": "..err);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   646
						print(unpack(value_list));
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   647
					end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   648
				end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   649
			end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   650
		end
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   651
	end;
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   652
});
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   653
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   654
print("table_count", table_count);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   655
print("insert_count", insert_count);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   656
print("row_count", row_count);
12fb961c8f27 tools/jabberd14sql2prosody: Initial commit. Accounts, rosters, vCards, subscriptions and offline messages supported (thanks halfdan for all the testing).
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
   657