Skip to content
This repository

Issue #141 - Fix Gist paste #142

Merged
merged 1 commit into from over 1 year ago

2 participants

Chris Peterson Satoshi Nakagawa
Chris Peterson

This is a fix for issue #141 ("Could not get URL from GIST"). GitHub changed the name of Gist's form variables, so it rejected LimeChat's paste requests with HTTP 500 responses.

Satoshi Nakagawa
Owner

Thanks!

Satoshi Nakagawa psychs merged commit 00c4f71 into from
Satoshi Nakagawa psychs closed this
Chris Peterson

Awesome! :D

Chris Peterson cpeterso deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Feb 21, 2013
Chris Peterson cpeterso Issue #141 - Fix Gist paste 9d2340b
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 23 additions and 22 deletions. Show diff stats Hide diff stats

  1. +17 17 Classes/Dialogs/PasteSheet.m
  2. +6 5 Classes/Library/GistClient.m
34 Classes/Dialogs/PasteSheet.m
@@ -38,22 +38,22 @@ - (id)init
38 38
39 39 if (!SYNTAX_EXT_MAP) {
40 40 SYNTAX_EXT_MAP = [[NSDictionary dictionaryWithObjectsAndKeys:
41   - @".c", @"c",
42   - @".css", @"css",
43   - @".diff", @"diff",
44   - @".hs", @"haskell",
45   - @".html", @"html",
46   - @".java", @"java",
47   - @".js", @"javascript",
48   - @".m", @"objective-c",
49   - @".pl", @"perl",
50   - @".aw", @"php",
51   - @".txt", @"plain_text",
52   - @".py", @"python",
53   - @".rb", @"ruby",
54   - @".scm", @"scheme",
55   - @".sh", @"shell script",
56   - @".sql", @"sql",
  41 + @"C", @"c",
  42 + @"CSS", @"css",
  43 + @"Diff", @"diff",
  44 + @"Haskell", @"haskell",
  45 + @"HTML", @"html",
  46 + @"Java", @"java",
  47 + @"JavaScript", @"javascript",
  48 + @"Objective-C", @"objective-c",
  49 + @"Perl", @"perl",
  50 + @"PHP", @"php",
  51 + @"Text", @"plain_text",
  52 + @"Python", @"python",
  53 + @"Ruby", @"ruby",
  54 + @"Scheme", @"scheme",
  55 + @"Shell", @"shell script",
  56 + @"SQL", @"sql",
57 57 nil, nil] retain];
58 58 }
59 59 }
@@ -105,7 +105,7 @@ - (void)pasteOnline:(id)sender
105 105 NSString* s = bodyText.string;
106 106 NSString* fileType = [SYNTAX_EXT_MAP objectForKey:[self syntaxFromTag:syntaxPopup.selectedTag]];
107 107 if (!fileType) {
108   - fileType = @".txt";
  108 + fileType = @"Text";
109 109 }
110 110
111 111 gist = [GistClient new];
11 Classes/Library/GistClient.m
@@ -74,12 +74,13 @@ - (void)postDataWithAutheToken:(NSString*)authToken
74 74 stage = kGistClientPost;
75 75
76 76 NSMutableDictionary* params = [NSMutableDictionary dictionary];
77   - [params setObject:@"" forKey:@"description"];
78   - [params setObject:@"" forKey:@"file_name[gistfile1]"];
79   - [params setObject:text forKey:@"file_contents[gistfile1]"];
80   - [params setObject:fileType forKey:@"file_ext[gistfile1]"];
  77 + [params setObject:@"" forKey:@"gist[description]"];
  78 + [params setObject:@"" forKey:@"gist[files][][oid]"];
  79 + [params setObject:@"" forKey:@"gist[files][][name]"];
  80 + [params setObject:text forKey:@"gist[files][][content]"];
  81 + [params setObject:fileType forKey:@"gist[files][][language]"];
81 82 if (isPrivate) {
82   - [params setObject:@"private" forKey:@"action_button"];
  83 + [params setObject:@"0" forKey:@"gist[public]"];
83 84 }
84 85 if (authToken) {
85 86 [params setObject:authToken forKey:@"authenticity_token"];

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.