Giter Club home page Giter Club logo

znc-mysql's People

Contributors

buxxi avatar frdmn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

arrjay

znc-mysql's Issues

Another encoding issue

As mentioned in #1, there's still an issue with some surrogates:

<*sql> Could not save SAY to database caused by: <class 'UnicodeEncodeError'> 'utf-8' codec can't encode character '\udcf3' in position 15: surrogates not allowed

and

<*sql> Could not save SAY to database caused by: <class 'UnicodeEncodeError'> 'utf-8' codec can't encode character '\udcd0' in position 0: surrogates not allowed

Encoding issue with emoji

I know I know, emojis in IRC... but they happen.

I upgraded from Ubuntu 14.04 to 16.04 and now whenever someone posts something containing an emoji, *sql sends this:
Could not save SAY to database caused by: <class 'pymysql.err.InternalError'> (1366, "Incorrect string value: '\\xF0\\x9F\\x98\\x82' for column 'message' at row 1")

I did some research and found out that apparently the MySQL utf8 encoding can't store 4-byte strings and hence throws this error. Using utf8mb4 is said to be the solution, working from MySQL 5.5 upwards.

I was wondering why I didn't get this bug with the old OS and actually grepped for an emoji in my text log files, and then looked up a message containing an emoji in the SQL DB. Sure enough, the message was there, just without an emoji, as if it had been removed.

I think this is responsible for that: https://github.com/buxxi/znc-mysql/blob/master/sql.py#L112

I do wonder why this used to work before. Maybe this line replaced characters python considered invalid, and a newer python version (due to OS upgrade) is now compatible with emoji and passes them on to MySQL which then throws the error.

Does not log channel messages with znc 1.7

ZNC 1.7 recently became stable, and because I am using teward's ubuntu PPA, I suddenly had upgraded from 1.6.3 without really knowing.

Ever since, channel messages aren't being logged anymore. Actions are, and I also see joins, quits and other things. I tried to debug this, but I just couldn't find out what's wrong. I don't get any errors.

Global module might be a bad idea

I noticed the most recent version doesn't accept --type=network anymore. Looking at the code, it looks like it's a global module now.

My znc has >10 users, and now all messages of all users are being logged, resulting in duplicate entries in the database when users share a channel. If this is intentional, the (znc) user responsible for the entry should have a column too. I like loading as network or user module better though. I only want to log my own stuff, having my other user's messages in the same DB is kind of privacy invading.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.