-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify WebSocket Client #79
Conversation
1, | ||
null); | ||
} catch (Error err) { | ||
stderr.printf ("error: " + err.message + "\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stderr.printf ("error: " + err.message + "\n"); | |
stderr.printf (@"error: $(err.message)\n"); |
|
||
onOpen (); | ||
} | ||
|
||
private void onOpen () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void onOpen () { | |
private void on_open () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the preferred coding style.
stderr.printf (err.message); | ||
} | ||
|
||
private void onMessage (int type, Bytes msg) { | ||
private void onMessage (int type, Bytes message) { | ||
if (type != Soup.WebsocketDataType.TEXT)return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (type != Soup.WebsocketDataType.TEXT)return; | |
if (type != Soup.WebsocketDataType.TEXT) { | |
return; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please everywhere
} | ||
stdout.printf ("received: " + str.str + "\n"); | ||
string text = (string) message.get_data (); | ||
stdout.printf ("received: " + text + "\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdout.printf ("received: " + text + "\n"); | |
stdout.printf (@"received: $text\n"); |
stdout.printf ("sent: " + msg + "\n"); | ||
connection.send_text (msg); | ||
private void send (string text) { | ||
stdout.printf ("sent: " + text + "\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdout.printf ("sent: " + text + "\n"); | |
stdout.printf (@"sent: $text\n"); |
null, | ||
null, | ||
1, | ||
null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the code formatters doing? seems like this should also be improved...
var entry_url = workbench.builder.get_object ("entry_url") as Gtk.Entry; | ||
|
||
try { | ||
var uri = GLib.Uri.parse (entry_url.get_text (), GLib.UriFlags.NONE).to_string (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var uri = GLib.Uri.parse (entry_url.get_text (), GLib.UriFlags.NONE).to_string (); | |
string uri = GLib.Uri.parse (entry_url.get_text (), GLib.UriFlags.NONE).to_string (); |
@lw64 you are asking to change code that wasn't introduced in this PR. Can you push the changes in this branch directly? |
@sonnyp sorry for all the change requests, I am not really expecting from you to fix all that :) I will see when I have time! |
The review is for the submitter, it's not for you. Please consider approving and create a follow-up issue or PR to address changes in existing Vala code. |
Also fixes
close
not firing in Vala for some reason