Skip to content

Commit e07b13f

Browse files
authored
Merge pull request #4 from VectorPrivacy/master
v0.1.7 - Hotfix 1
2 parents a686599 + 1e1d1f1 commit e07b13f

File tree

7 files changed

+575
-17
lines changed

7 files changed

+575
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Rust Stable and Tauri must be installed along with other dependencies. The easie
3030
Assuming you want Vector in an `apps` folder (adjust as necessary):
3131

3232
```
33-
cd ~/apps && git pull https://github.com/JSKitty/Vector
33+
cd ~/apps && git pull https://github.com/VectorPrivacy/Vector
3434
```
3535

3636
```

docs/typing-indicator.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ The `expiration` tag MUST be set within the next 30 seconds, it CANNOT be higher
3838
}
3939
```
4040

41-
The [Event Creation Implementation Code](https://github.com/JSKitty/Vector/blob/cb616b75c8ba49960f887d1a7cf2a052898c49a4/src-tauri/src/lib.rs#L495) that generated this example (before redacting keys).
41+
The [Event Creation Implementation Code](https://github.com/VectorPrivacy/Vector/blob/cb616b75c8ba49960f887d1a7cf2a052898c49a4/src-tauri/src/lib.rs#L495) that generated this example (before redacting keys).
4242

4343
# Client Implementation
4444

4545
A client SHOULD immediately display that a user is typing, if it receives a Typing Indicator Event with their Public Key, from a known user.
4646

4747
A client SHOULD NOT handle a Typing Indicator Event sent from an unknown user.
4848

49-
A client SHOULD immediately drop the Typing Indicator IF the sender has completed and sent their message. (i.e: if a received Message has a `created_at` newer than their Typing Indicator Event, then do NOT display them as typing). [Example Code](https://github.com/JSKitty/Vector/blob/cb616b75c8ba49960f887d1a7cf2a052898c49a4/src-tauri/src/lib.rs#L80).
49+
A client SHOULD immediately drop the Typing Indicator IF the sender has completed and sent their message. (i.e: if a received Message has a `created_at` newer than their Typing Indicator Event, then do NOT display them as typing). [Example Code](https://github.com/VectorPrivacy/Vector/blob/cb616b75c8ba49960f887d1a7cf2a052898c49a4/src-tauri/src/lib.rs#L80).
5050

5151
A client SHOULD NOT accept Typing Indicator Events longer than 30 seconds from the current time.
5252

53-
The [Client Receiver Implementation Code](https://github.com/JSKitty/Vector/blob/cb616b75c8ba49960f887d1a7cf2a052898c49a4/src-tauri/src/lib.rs#L627), which provides an example on how to handle incoming Typing Indicator Events.
53+
The [Client Receiver Implementation Code](https://github.com/VectorPrivacy/Vector/blob/cb616b75c8ba49960f887d1a7cf2a052898c49a4/src-tauri/src/lib.rs#L627), which provides an example on how to handle incoming Typing Indicator Events.
5454

5555
# Giftwrapping (NIP-59)
5656

@@ -64,4 +64,4 @@ If your client supports disappearing messages, and you are actively using them,
6464

6565
For additional privacy, you may select a singular "Trusted Relay" to handle Typing Indicator Events, an approach also taken by the Vector client.
6666

67-
The [Event Giftwrapping Implementation Code](https://github.com/JSKitty/Vector/blob/f2fa50543c740a7054b04fa5d341ca14ed8b7a13/src-tauri/src/lib.rs#L508) of a giftwrapped Typing Indicator with extended public `expiration` timestamp.
67+
The [Event Giftwrapping Implementation Code](https://github.com/VectorPrivacy/Vector/blob/f2fa50543c740a7054b04fa5d341ca14ed8b7a13/src-tauri/src/lib.rs#L508) of a giftwrapped Typing Indicator with extended public `expiration` timestamp.

src-tauri/src/lib.rs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,19 +1206,109 @@ async fn handle_event(event: Event, is_new: bool) -> bool {
12061206
"image/jpeg" | "image/jpg" => "jpg",
12071207
"image/gif" => "gif",
12081208
"image/webp" => "webp",
1209+
"image/svg+xml" => "svg",
1210+
"image/bmp" | "image/x-ms-bmp" => "bmp",
1211+
"image/x-icon" | "image/vnd.microsoft.icon" => "ico",
1212+
"image/tiff" => "tiff",
1213+
1214+
// Raw Images
1215+
"image/x-adobe-dng" => "dng",
1216+
"image/x-canon-cr2" => "cr2",
1217+
"image/x-nikon-nef" => "nef",
1218+
"image/x-sony-arw" => "arw",
1219+
12091220
// Audio
12101221
"audio/wav" | "audio/x-wav" | "audio/wave" => "wav",
12111222
"audio/mp3" | "audio/mpeg" => "mp3",
12121223
"audio/flac" => "flac",
12131224
"audio/ogg" => "ogg",
12141225
"audio/mp4" => "m4a",
12151226
"audio/aac" | "audio/x-aac" => "aac",
1227+
"audio/x-ms-wma" => "wma",
1228+
"audio/opus" => "opus",
1229+
12161230
// Videos
12171231
"video/mp4" => "mp4",
12181232
"video/webm" => "webm",
12191233
"video/quicktime" => "mov",
12201234
"video/x-msvideo" => "avi",
12211235
"video/x-matroska" => "mkv",
1236+
"video/x-flv" => "flv",
1237+
"video/x-ms-wmv" => "wmv",
1238+
"video/mpeg" => "mpg",
1239+
"video/3gpp" => "3gp",
1240+
"video/ogg" => "ogv",
1241+
"video/mp2t" => "ts",
1242+
1243+
// Documents
1244+
"application/pdf" => "pdf",
1245+
"application/msword" => "doc",
1246+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" => "docx",
1247+
"application/vnd.ms-excel" => "xls",
1248+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" => "xlsx",
1249+
"application/vnd.ms-powerpoint" => "ppt",
1250+
"application/vnd.openxmlformats-officedocument.presentationml.presentation" => "pptx",
1251+
"application/vnd.oasis.opendocument.text" => "odt",
1252+
"application/vnd.oasis.opendocument.spreadsheet" => "ods",
1253+
"application/vnd.oasis.opendocument.presentation" => "odp",
1254+
"application/rtf" => "rtf",
1255+
1256+
// Text/Data
1257+
"text/plain" => "txt",
1258+
"text/markdown" => "md",
1259+
"text/csv" => "csv",
1260+
"application/json" => "json",
1261+
"application/xml" | "text/xml" => "xml",
1262+
"application/x-yaml" | "text/yaml" => "yaml",
1263+
"application/toml" => "toml",
1264+
"application/sql" => "sql",
1265+
1266+
// Archives
1267+
"application/zip" => "zip",
1268+
"application/x-rar-compressed" | "application/vnd.rar" => "rar",
1269+
"application/x-7z-compressed" => "7z",
1270+
"application/x-tar" => "tar",
1271+
"application/gzip" => "gz",
1272+
"application/x-bzip2" => "bz2",
1273+
"application/x-xz" => "xz",
1274+
"application/x-iso9660-image" => "iso",
1275+
"application/x-apple-diskimage" => "dmg",
1276+
"application/vnd.android.package-archive" => "apk",
1277+
"application/java-archive" => "jar",
1278+
1279+
// 3D Files
1280+
"model/obj" | "text/plain" => "obj",
1281+
"model/gltf+json" => "gltf",
1282+
"model/gltf-binary" => "glb",
1283+
"model/stl" | "application/sla" => "stl",
1284+
"model/vnd.collada+xml" => "dae",
1285+
1286+
// Code
1287+
"text/javascript" | "application/javascript" => "js",
1288+
"text/typescript" | "application/typescript" => "ts",
1289+
"text/x-python" | "application/x-python" => "py",
1290+
"text/x-rust" => "rs",
1291+
"text/x-go" => "go",
1292+
"text/x-java" => "java",
1293+
"text/x-c" => "c",
1294+
"text/x-c++" => "cpp",
1295+
"text/x-csharp" => "cs",
1296+
"text/x-ruby" => "rb",
1297+
"text/x-php" => "php",
1298+
"text/x-swift" => "swift",
1299+
1300+
// Web
1301+
"text/html" => "html",
1302+
"text/css" => "css",
1303+
1304+
// Other
1305+
"application/x-msdownload" | "application/x-dosexec" => "exe",
1306+
"application/x-msi" => "msi",
1307+
"application/x-font-ttf" | "font/ttf" => "ttf",
1308+
"application/x-font-otf" | "font/otf" => "otf",
1309+
"font/woff" => "woff",
1310+
"font/woff2" => "woff2",
1311+
12221312
// Fallback - extract extension from mime subtype
12231313
_ => mime_type.split('/').nth(1).unwrap_or("bin"),
12241314
};

src-tauri/src/util.rs

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ pub fn get_file_type_description(extension: &str) -> String {
6161
map.insert("jpeg", "Picture");
6262
map.insert("gif", "GIF Animation");
6363
map.insert("webp", "Picture");
64+
map.insert("svg", "Vector Image");
65+
map.insert("bmp", "Bitmap Image");
66+
map.insert("ico", "Icon");
67+
map.insert("tiff", "TIFF Image");
68+
map.insert("tif", "TIFF Image");
69+
70+
// Raw Images
71+
map.insert("raw", "RAW Image");
72+
map.insert("dng", "RAW Image");
73+
map.insert("cr2", "Canon RAW");
74+
map.insert("nef", "Nikon RAW");
75+
map.insert("arw", "Sony RAW");
76+
map.insert("orf", "Olympus RAW");
77+
map.insert("rw2", "Panasonic RAW");
6478

6579
// Audio
6680
map.insert("wav", "Voice Message");
@@ -69,13 +83,220 @@ pub fn get_file_type_description(extension: &str) -> String {
6983
map.insert("aac", "Audio Clip");
7084
map.insert("flac", "Audio Clip");
7185
map.insert("ogg", "Audio Clip");
86+
map.insert("wma", "Audio Clip");
87+
map.insert("opus", "Audio Clip");
88+
map.insert("ape", "Audio Clip");
89+
map.insert("wv", "Audio Clip");
90+
91+
// Audio Project Files
92+
map.insert("aup", "Audacity Project");
93+
map.insert("flp", "FL Studio Project");
94+
map.insert("als", "Ableton Project");
95+
map.insert("logic", "Logic Project");
96+
map.insert("band", "GarageBand Project");
7297

7398
// Videos
7499
map.insert("mp4", "Video");
75100
map.insert("webm", "Video");
76101
map.insert("mov", "Video");
77102
map.insert("avi", "Video");
78103
map.insert("mkv", "Video");
104+
map.insert("flv", "Flash Video");
105+
map.insert("wmv", "Windows Video");
106+
map.insert("mpg", "MPEG Video");
107+
map.insert("mpeg", "MPEG Video");
108+
map.insert("m4v", "MPEG-4 Video");
109+
map.insert("3gp", "3GP Video");
110+
map.insert("3g2", "3G2 Video");
111+
map.insert("f4v", "Flash MP4 Video");
112+
map.insert("asf", "Advanced Systems Format");
113+
map.insert("rm", "RealMedia");
114+
map.insert("vob", "DVD Video");
115+
map.insert("ogv", "Ogg Video");
116+
map.insert("mxf", "Material Exchange Format");
117+
map.insert("ts", "MPEG Transport Stream");
118+
map.insert("m2ts", "Blu-ray Video");
119+
120+
// Documents
121+
map.insert("pdf", "PDF Document");
122+
map.insert("doc", "Word Document");
123+
map.insert("docx", "Word Document");
124+
map.insert("xls", "Excel Spreadsheet");
125+
map.insert("xlsx", "Excel Spreadsheet");
126+
map.insert("ppt", "PowerPoint Presentation");
127+
map.insert("pptx", "PowerPoint Presentation");
128+
map.insert("odt", "OpenDocument Text");
129+
map.insert("ods", "OpenDocument Spreadsheet");
130+
map.insert("odp", "OpenDocument Presentation");
131+
map.insert("rtf", "Rich Text Document");
132+
map.insert("tex", "LaTeX Document");
133+
map.insert("pages", "Pages Document");
134+
map.insert("numbers", "Numbers Spreadsheet");
135+
map.insert("key", "Keynote Presentation");
136+
137+
// Text Files
138+
map.insert("txt", "Text File");
139+
map.insert("md", "Markdown");
140+
map.insert("log", "Log File");
141+
map.insert("csv", "CSV File");
142+
map.insert("tsv", "TSV File");
143+
144+
// Data Files
145+
map.insert("json", "JSON File");
146+
map.insert("xml", "XML File");
147+
map.insert("yaml", "YAML File");
148+
map.insert("yml", "YAML File");
149+
map.insert("toml", "TOML File");
150+
map.insert("sql", "SQL File");
151+
map.insert("db", "Database File");
152+
map.insert("sqlite", "SQLite Database");
153+
154+
// Archives
155+
map.insert("zip", "ZIP Archive");
156+
map.insert("rar", "RAR Archive");
157+
map.insert("7z", "7-Zip Archive");
158+
map.insert("tar", "TAR Archive");
159+
map.insert("gz", "GZip Archive");
160+
map.insert("bz2", "BZip2 Archive");
161+
map.insert("xz", "XZ Archive");
162+
map.insert("tgz", "Compressed TAR");
163+
map.insert("tbz", "Compressed TAR");
164+
map.insert("txz", "Compressed TAR");
165+
map.insert("cab", "Cabinet Archive");
166+
map.insert("iso", "Disc Image");
167+
map.insert("dmg", "macOS Disk Image");
168+
map.insert("pkg", "Package File");
169+
map.insert("deb", "Debian Package");
170+
map.insert("rpm", "RPM Package");
171+
map.insert("apk", "Android Package");
172+
map.insert("ipa", "iOS App");
173+
map.insert("jar", "Java Archive");
174+
map.insert("war", "Web Archive");
175+
map.insert("ear", "Enterprise Archive");
176+
177+
// 3D Files
178+
map.insert("obj", "3D Object");
179+
map.insert("fbx", "Autodesk FBX");
180+
map.insert("gltf", "GL Transmission Format");
181+
map.insert("glb", "GL Binary");
182+
map.insert("stl", "Stereolithography");
183+
map.insert("ply", "Polygon File");
184+
map.insert("dae", "COLLADA");
185+
map.insert("3ds", "3D Studio");
186+
map.insert("blend", "Blender File");
187+
map.insert("c4d", "Cinema 4D");
188+
map.insert("max", "3ds Max");
189+
map.insert("ma", "Maya ASCII");
190+
map.insert("mb", "Maya Binary");
191+
map.insert("usdz", "Universal Scene");
192+
193+
// CAD Files
194+
map.insert("dwg", "AutoCAD Drawing");
195+
map.insert("dxf", "Drawing Exchange");
196+
map.insert("step", "STEP CAD");
197+
map.insert("stp", "STEP CAD");
198+
map.insert("iges", "IGES CAD");
199+
map.insert("igs", "IGES CAD");
200+
map.insert("sat", "ACIS SAT");
201+
map.insert("ipt", "Inventor Part");
202+
map.insert("iam", "Inventor Assembly");
203+
map.insert("prt", "Part File");
204+
map.insert("sldprt", "SolidWorks Part");
205+
map.insert("sldasm", "SolidWorks Assembly");
206+
map.insert("slddrw", "SolidWorks Drawing");
207+
map.insert("catpart", "CATIA Part");
208+
map.insert("catproduct", "CATIA Product");
209+
210+
// Code Files
211+
map.insert("js", "JavaScript");
212+
map.insert("ts", "TypeScript");
213+
map.insert("jsx", "React JSX");
214+
map.insert("tsx", "React TSX");
215+
map.insert("py", "Python");
216+
map.insert("rs", "Rust");
217+
map.insert("go", "Go");
218+
map.insert("java", "Java");
219+
map.insert("kt", "Kotlin");
220+
map.insert("cpp", "C++");
221+
map.insert("cc", "C++");
222+
map.insert("cxx", "C++");
223+
map.insert("c", "C");
224+
map.insert("h", "Header File");
225+
map.insert("hpp", "C++ Header");
226+
map.insert("cs", "C#");
227+
map.insert("rb", "Ruby");
228+
map.insert("php", "PHP");
229+
map.insert("swift", "Swift");
230+
map.insert("m", "Objective-C");
231+
map.insert("mm", "Objective-C++");
232+
map.insert("lua", "Lua");
233+
map.insert("r", "R Script");
234+
map.insert("scala", "Scala");
235+
map.insert("clj", "Clojure");
236+
map.insert("dart", "Dart");
237+
map.insert("ex", "Elixir");
238+
map.insert("elm", "Elm");
239+
map.insert("erl", "Erlang");
240+
map.insert("fs", "F#");
241+
map.insert("hs", "Haskell");
242+
map.insert("jl", "Julia");
243+
map.insert("nim", "Nim");
244+
map.insert("pl", "Perl");
245+
map.insert("sh", "Shell Script");
246+
map.insert("bash", "Bash Script");
247+
map.insert("zsh", "Zsh Script");
248+
map.insert("fish", "Fish Script");
249+
map.insert("ps1", "PowerShell");
250+
map.insert("bat", "Batch File");
251+
map.insert("cmd", "Command File");
252+
map.insert("vb", "Visual Basic");
253+
map.insert("vbs", "VBScript");
254+
map.insert("asm", "Assembly");
255+
map.insert("s", "Assembly");
256+
257+
// Config Files
258+
map.insert("ini", "INI Config");
259+
map.insert("cfg", "Config File");
260+
map.insert("conf", "Config File");
261+
map.insert("config", "Config File");
262+
map.insert("env", "Environment File");
263+
map.insert("properties", "Properties File");
264+
map.insert("plist", "Property List");
265+
map.insert("gitignore", "Git Ignore");
266+
map.insert("dockerignore", "Docker Ignore");
267+
map.insert("editorconfig", "Editor Config");
268+
map.insert("eslintrc", "ESLint Config");
269+
map.insert("prettierrc", "Prettier Config");
270+
271+
// Web Files
272+
map.insert("html", "HTML File");
273+
map.insert("htm", "HTML File");
274+
map.insert("css", "CSS Stylesheet");
275+
map.insert("scss", "SCSS Stylesheet");
276+
map.insert("sass", "Sass Stylesheet");
277+
map.insert("less", "Less Stylesheet");
278+
map.insert("vue", "Vue Component");
279+
map.insert("svelte", "Svelte Component");
280+
281+
// Vector Graphics
282+
map.insert("eps", "Encapsulated PostScript");
283+
map.insert("ai", "Adobe Illustrator");
284+
map.insert("sketch", "Sketch File");
285+
map.insert("fig", "Figma File");
286+
map.insert("xd", "Adobe XD");
287+
288+
// Other
289+
map.insert("exe", "Executable");
290+
map.insert("msi", "Windows Installer");
291+
map.insert("app", "macOS Application");
292+
map.insert("ttf", "TrueType Font");
293+
map.insert("otf", "OpenType Font");
294+
map.insert("woff", "Web Font");
295+
map.insert("woff2", "Web Font 2");
296+
map.insert("eot", "Embedded OpenType");
297+
map.insert("ics", "Calendar File");
298+
map.insert("vcf", "vCard Contact");
299+
map.insert("torrent", "Torrent File");
79300

80301
map
81302
});

0 commit comments

Comments
 (0)