about summary refs log tree commit diff stats
path: root/src/profanity.h
Commit message (Expand)AuthorAgeFilesLines
* Define lock in profanity.h as externMichael Vetter2020-04-171-1/+1
* Add -t theme optionMichael Vetter2020-03-241-1/+1
* Allow setting custom log file via -f FILENAMEMichael Vetter2020-02-211-1/+1
* Update my Copyright to 2020Michael Vetter2020-01-031-1/+1
* Add vim modelineMichael Vetter2019-11-131-0/+1
* Possibility to specify alternative config fileMichael Vetter2019-08-021-1/+2
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
* Update copyrightJames Booth2018-01-211-1/+1
* Update CopyrightJames Booth2017-01-281-1/+1
* Remove unused function prototypeJames Booth2016-07-251-3/+0
* Tidy headersJames Booth2016-07-241-0/+1
* Moved chat state handling code to chat_state.cJames Booth2016-07-241-5/+0
* Update GPL link in headersJames Booth2016-07-241-1/+1
* Implement XEP-0363: HTTP File UploadDominik Heidler2016-04-261-0/+4
* Merge branch 'master' into plugins-cJames Booth2016-02-141-1/+1
|\
| * Updated copyrightJames Booth2016-02-141-1/+1
* | Added C plugin code from plugins branchJames Booth2016-02-141-2/+1
|/
* Allow /quit during TLS certificate verification promptJames Booth2015-11-101-0/+2
* Removed --disable-tls command line optionJames Booth2015-10-181-1/+1
* Updated copyrightJames Booth2015-02-101-1/+1
* Added license exemption for OpenSSL to source headersJames Booth2014-08-241-0/+12
* Updated copyrightJames Booth2014-03-091-1/+1
* Implemented basic running of alias commandsJames Booth2014-01-231-0/+2
* Refactored roster add/updateJames Booth2014-01-051-1/+0
* Removed prof_handle group functionsJames Booth2014-01-051-2/+0
* Removed unused function prototypeJames Booth2014-01-051-1/+0
* Removed unused function prototypeJames Booth2014-01-051-1/+0
* Removed prof_handle_disconnectJames Booth2014-01-051-1/+0
* Removed unused function prototypeJames Booth2014-01-051-1/+0
* Moved roster handlers to server_eventsJames Booth2014-01-051-3/+0
* Moved presence handlers to server_eventsJames Booth2014-01-051-18/+0
* Moved messages handlers to server_eventsJames Booth2014-01-051-17/+0
* Moved handle_room_list and handle_disco_items to server_eventsJames Booth2014-01-051-2/+0
* Moved handle_disco_info to server_eventsJames Booth2014-01-051-2/+0
* Moved handle_software_version_result to server_eventsJames Booth2014-01-051-3/+0
* Moved handle_lost_connection and handle_failed_login to server_eventsJames Booth2014-01-051-4/+0
* Connect to an account on start-upTomás Senart2013-10-141-1/+1
* Show messages on /group add and /group removeJames Booth2013-06-231-0/+2
* Show message when removing contact from group when not in groupJames Booth2013-06-231-1/+2
* Show message when contact already in groupJames Booth2013-06-231-0/+1
* Added message in console on /roster removeJames Booth2013-06-021-0/+1
* Added message in console on /roster addJames Booth2013-06-021-0/+1
* Added /duck command to perform searches using duckduckgo chat botJames Booth2013-05-051-0/+2
* Show message in console when receiving chat room invitesJames Booth2013-03-241-0/+3
* Implemented output for /disco infoJames Booth2013-03-141-0/+2
* Added output for /disco itemsJames Booth2013-03-141-0/+1
* Added basic /rooms command to get chat room listJames Booth2013-03-131-0/+1
* Colour title on /caps and /software outputJames Booth2013-02-171-1/+2
* Added autocomplete for /software commandJames Booth2013-02-171-0/+2
* Simple default resource hanlding on presenceJames Booth2013-02-141-2/+3
: raise ValueError("Cannot shrink down to that size by cutting") leftsize = self.left.sumsize() rightsize = self.right.sumsize() nonfixed_items = self.left.nonfixed_items() itemsize = int(float(wid - rightsize - fixedsize) / \ (nonfixed_items + 1)) + 1 for item in self.left: if not item.fixed: item.cut_off_to(itemsize) self.fill_gap(' ', wid, gapwidth=False) def fill_gap(self, char, wid, gapwidth=False): del self.gap[:] if not gapwidth: wid = wid - self.sumsize() if wid > 0: self.gap.add(char * wid, 'space') def combine(self): return self.left + self.gap + self.right class BarSide(list): def __init__(self, base_color_tag): self.base_color_tag = base_color_tag def add(self, string, *lst, **kw): cs = ColoredString(string, self.base_color_tag, *lst) cs.__dict__.update(kw) self.append(cs) def add_space(self, n=1): self.add(' ' * n, 'space') def sumsize(self): return sum(len(item) for item in self) def fixedsize(self): n = 0 for item in self: if item.fixed: n += len(item) else: n += 1 return n def nonfixed_items(self): return sum(1 for item in self if not item.fixed) class ColoredString(object): def __init__(self, string, *lst): self.string = string self.lst = lst self.fixed = False def cut_off(self, n): n = max(n, min(len(self.string), 1)) self.string = self.string[:-n] def cut_off_to(self, n): self.string = self.string[:n] def __len__(self): return uwid(self.string) def __str__(self): return self.string