summaryrefslogtreecommitdiffstats
path: root/db/feed.php
blob: f78b1f364d61b99b51d3fe278fa01681107e64b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php
/**
 * ownCloud - News
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Alessandro Cosentino <cosenal@gmail.com>
 * @author Bernhard Posselt <dev@bernhard-posselt.com>
 * @copyright Alessandro Cosentino 2012
 * @copyright Bernhard Posselt 2012, 2014
 */

namespace OCA\News\Db;

use \OCP\AppFramework\Db\Entity;

/**
 * @method integer getId()
 * @method void setId(integer $value)
 * @method string getUserId()
 * @method void setUserId(string $value)
 * @method int getOrdering()
 * @method void setOrdering(int $value)
 * @method string getUrlHash()
 * @method void setUrlHash(string $value)
 * @method string getLocation()
 * @method void setLocation(string $value)
 * @method string getUrl()
 * @method string getTitle()
 * @method void setTitle(string $value)
 * @method string getLastModified()
 * @method void setLastModified(string $value)
 * @method string getEtag()
 * @method void setEtag(string $value)
 * @method string getFaviconLink()
 * @method void setFaviconLink(string $value)
 * @method integer getAdded()
 * @method void setAdded(integer $value)
 * @method boolean getPinned()
 * @method void setPinned(boolean $value)
 * @method integer getFolderId()
 * @method void setFolderId(integer $value)
 * @method integer getFullTextEnabled()
 * @method void setFullTextEnabled(bool $value)
 * @method integer getUnreadCount()
 * @method void setUnreadCount(integer $value)
 * @method string getLink()
 * @method boolean getPreventUpdate()
 * @method void setPreventUpdate(boolean $value)
 * @method integer getDeletedAt()
 * @method void setDeletedAt(integer $value)
 * @method integer getArticlesPerUpdate()
 * @method void setArticlesPerUpdate(integer $value)
 * @method integer getUpdateErrorCount()
 * @method void setUpdateErrorCount(integer $value)
 * @method string getLastUpdateError()
 * @method void setLastUpdateError(string $value)
 * @method string getBasicAuthUser()
 * @method void setBasicAuthUser(string $value)
 * @method string getBasicAuthPassword()
 * @method void setBasicAuthPassword(string $value)
 */
class Feed extends Entity implements IAPI, \JsonSerializable {

    use EntityJSONSerializer;

    protected $userId;
    protected $urlHash;
    protected $url;
    protected $title;
    protected $faviconLink;
    protected $added;
    protected $folderId;
    protected $unreadCount;
    protected $link;
    protected $preventUpdate;
    protected $deletedAt;
    protected $articlesPerUpdate;
    protected $lastModified;
    protected $etag;
    protected $location;
    protected $ordering;
    protected $fullTextEnabled;
    protected $pinned;
    protected $updateMode;
    protected $updateErrorCount;
    protected $lastUpdateError;
    protected $basicAuthUser;
    protected $basicAuthPassword;

    public function __construct(){
        $this->addType('parentId', 'integer');
        $this->addType('added', 'integer');
        $this->addType('folderId', 'integer');
        $this->addType('unreadCount', 'integer');
        $this->addType('preventUpdate', 'boolean');
        $this->addType('pinned', 'boolean');
        $this->addType('deletedAt', 'integer');
        $this->addType('articlesPerUpdate', 'integer');
        $this->addType('ordering', 'integer');
        $this->addType('fullTextEnabled', 'boolean');
        $this->addType('updateMode', 'integer');
        $this->addType('updateErrorCount', 'integer');
    }


    /**
     * Turns entitie attributes into an array
     */
    public function jsonSerialize() {
        $serialized = $this->serializeFields([
            'id',
            'userId',
            'urlHash',
            'url',
            'title',
            'faviconLink',
            'added',
            'folderId',
            'unreadCount',
            'link',
            'preventUpdate',
            'deletedAt',
            'articlesPerUpdate',
            'location',
            'ordering',
            'fullTextEnabled',
            'pinned',
            'updateMode',
            'updateErrorCount',
            'lastUpdateError',
            'basicAuthUser',
            'basicAuthPassword'
        ]);

        $url = parse_url($this->link)['host'];

        // strip leading www. to avoid css class confusion
        if (strpos($url, 'www.') === 0) {
            $url = substr($url, 4);
        }

        $serialized['cssClass'] = 'custom-' . str_replace('.', '-', $url);

        return $serialized;
    }


    public function toAPI() {
        return $this->serializeFields([
            'id',
            'url',
            'title',
            'faviconLink',
            'added',
            'folderId',
            'unreadCount',
            'ordering',
            'link',
            'pinned'
        ]);
    }


    public function setUrl($url) {
        $url = trim($url);
        if(strpos($url, 'http') === 0) {
            parent::setUrl($url);
            $this->setUrlHash(md5($url));
        }
    }


    public function setLink($url) {
        $url = trim($url);
        if(strpos($url, 'http') === 0) {
            parent::setLink($url);
        }
    }


}
/a> 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
# Changelog

All notable changes to Alacritty are documented in this file.
The sections should follow the order `Packaging`, `Added`, `Changed`, `Fixed` and `Removed`.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.14.0-dev

### Changed

- Pressing `Alt` with unicode input will now add `ESC` like for ASCII input

## 0.13.2

### Added

- Default `Home`/`End` bindings in Vi mode mapped to `First`/`Last` respectively

### Fixed

- CLI env variables clearing configuration file variables
- Vi inline search/semantic selection expanding across newlines
- C0 and C1 codes being emitted in associated text when using kitty keyboard
- Occasional hang on startup with some Wayland compositors
- Missing key for `NumpadDecimal` in key bindings
- Scrolling content upwards moving lines into history when it shouldn't
- Sticky keys not working sometimes on X11
- Modifiers occasionally getting desynced on X11
- Autokey no longer working with alacritty on X11
- Freeze when moving window between monitors on Xfwm
- Mouse cursor not changing on Wayland when cursor theme uses legacy cursor icon names
- Config keys are available under proper names
- Build failure when compiling with x11 feature on NetBSD
- Hint `Select` action selecting the entire line for URL escapes
- Kitty encoding used for regular keys when they don't carry text

### Changed

- No unused-key warnings will be emitted for OS-specific config keys
- Use built-in font for sextant symbols from `U+1FB00` to `U+1FB3B`
- Kitty encoding is not used anymore for uncommon keys unless the protocol enabled

## 0.13.1

### Added

- Support for pasting in Vi + Search mode

### Changed

- `alacritty migrate` will ignore null values in yaml instead of erroring out

### Fixed

- `alacritty migrate` failing with nonexistent imports
- `Alt` bindings requiring composed key rather than pre-composed one on macOS
- `Alt + Control` bindings not working on Windows
- `chars = "\u000A"` action in bindings inserting `\n`
- Alternate keys not sent for `Shift + <number>` when using kitty protocol
- Alternative keys being swapped in kitty protocol implementation
- Powerline glyphs being cut for narrow fonts
- Xmodmap not working on X11
- Occasional slow startup on some X11 window managers
- Blurry window when using `window.dimensions` on some Wayland compositors
- IME input lagging behind on X11
- xdotool modifiers input not working correctly on X11
- Parsing numbers fails for mouse bindings
- Some config options overriding each other in CLI/IPC
- Numpad `Left` used for numpad `Up`

## 0.13.0

### Packaging

- Minimum Rust version has been bumped to 1.70.0
- Manpages are now generated using `scdoc` (see `INSTALL.md`)

### Added

- Warnings for unused configuration file options
- Config option `persist` in `hints` config section
- Support for dynamically loading conpty.dll on Windows
- Support for keybindings with dead keys
- `Back`/`Forward` mouse buttons support in bindings
- Copy global IPC options (`-w -1`) for new windows
- Bindings to create and navigate tabs on macOS
- Support startup notify protocol to raise initial window on Wayland/X11
- Debug option `prefer_egl` to prioritize EGL over other display APIs
- Inline vi-mode search using `f`/`F`/`t`/`T`
- `window.blur` config option to request blur for transparent windows
- `--option` argument for `alacritty msg create-window`
- Support for `DECRQM`/`DECRPM` escape sequences
- Support for kitty's keyboard protocol

### Changed

- Mode-specific bindings can now be bound in any mode for easier macros
- `--help` output is more compact now and uses more neutral palette
- Configuration file now uses TOML instead of YAML
    Run `alacritty migrate` to automatically convert all configuration files
- Deprecated config option `draw_bold_text_with_bright_colors`, use
    `colors.draw_bold_text_with_bright_colors`
- Deprecated config option `key_bindings`, use `keyboard.bindings`
- Deprecated config option `mouse_bindings`, use `mouse.bindings`
- The default colorscheme is now based on base16 classic dark
- IME popup now tries to not obscure the current cursor line
- The double click threshold was raised to `400ms`
- OSC 52 paste ability is now **disabled by default**; use `terminal.osc52` to adjust it
- Apply `colors.transparent_background_colors` for selections, hints, and search matches
- Underline full hint during keyboard selection
- Synchronized updates now use `CSI 2026` instead of legacy